Part Number Hot Search : 
SRC1203 MC341 HT1621 ISD1416P MCSO1H NCE55H SAA7327 60000
Product Description
Full Text Search
 

To Download SH7268 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  application note r01a n0 778e j01 00 rev.1 . 00 page 1 of 105 apr 18, 2013 SH7268/sh7269 group video display controller 4 driver user?s manual introduction th is d o c u m en t exp l ain s t h e usag e o f sh 7268 /sh72 6 9 v i deo d i sp lay con t ro ller 4 (h er eaf t er r e f e r r e d t o as ?v d c 4 ? ) dri v er. target device sh7 268 /sh726 9 contents 1. overview ....................................................................................................................... .................... 2 2. api ............................................................................................................................ ......................... 9 3. user-defined func tions ......................................................................................................... .......... 82 4. example us age .................................................................................................................. ............. 87 r01a n0 778e j01 0 0 rev.1.00 apr 18, 201 3 http://
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 2 of 105 apr 18, 2013 1. overview 1.1 environment thi s pr o g ram was de vel o ped an d t e st ed i n t h e fol l o wi n g e nvi ro nm ent s . ? cpu ? sh7 269 ? devel opm ent envi ro nm ent ? he w ( s u p e rh r isc e n gi ne m i crocom put er soft wa re i n t e g rat ed de vel o p m ent envi ro nm ent ) ver s i o n 4. 09 .0 0. 0 07 ? r e nesas su per h r i sc e ngi ne st an dar d t o ol chai n ve rsi o n 9. 4. 1. 0 ? sh c/c++ c o m p i l er v e rsion 9 . 04 .0 1 ? sh a ssem b ler v e r s i o n 7.01 .02 ? sh c / c ++ st a nda r d li b r ary gene rat o r vers i on 3. 0 0 . 03 ? opt i m i z i ng li nka ge edi t o r v e rsi o n 10 .0 1. 0 0 ? eval uat i o n b o ard ? sh7 269 cpu b o a rd (par t num b e r : r0 k 5726 90 c 0 00 br) ? op tion a l b o a rd fo r graph i c d i sp lay (part nu mb er: m 3 a-hs64 g02) ? sh7 269 v d c 4 bo ard ( p ar t num b e r : r0 k 5726 90 b 0 00 br)
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 3 of 105 apr 18, 2013 1.2 features th e fo llowing tab l e lists th e featu r es supp orted b y th is d r i v er p r o g ram . table 1 features of v d c4 driv er image spe c ification ? itu-r bt.65 6 stand ard 8b it (27mhz) ? itu-r bt.60 1 stand ard 8b it (27mhz, interla c e sign al) ? itu-r bt.60 1 stand ard 8b it (54mhz, progressive si g nal) ? rgb8 88, rg b666 an d rg b565 video i m age image qu ality adjustment ? ho rizontal noi se redu ction ? b l ac k st ret c h ? sharp n e ss / lti picture re co rding ? ycc422, rg b565, rgb8 88 format a rate of 1/1, 1/2, 1/4 or 1/8 field input video sc aling / rotation ? scalin g input video imag e to output imag e vertic al / horiz ontal: x1/8 to x8 ? 0, 90, 180 or 270 degree rotation and horizontal mirroring layer ? 3 plane s gra phi cs 1 / video 1 gra phi cs 2 graphics 3 image fo rma t ? prog re ssiv e f ormat rgb565, rgb888, argb 1555, argb4444, argb8888 clut8, clut4, clut1, ycc422 2 gra phi cs image synthesi z e r ? alpha ble ndin g in re ctang ul ar area (fa de-in and fade -o ut function s) ? ch roma - k ey ? alpha blending in one pixel units siz e ? qvga, wqvga, vga, wvga, svga form at ? prog re ssive rgb5 65 / rgb666 / rgb 888 ? progressive rgb888 (serial output format) panel outp ut adjus t ment ? brightne ss / cont ra st / dither p r o c e ssi n g ? rgb gamma correction note s: 1. gra phi cs 1 a nd video a r e exclu s ive. 2. only for gra p h ics 1.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 4 of 105 apr 18, 2013 1.3 file configuration the fi l e co nfi g urat i o n of t h i s dri v er i s sh o w n bel o w. table 2 file con f igura t ion file name description vdc4_api.c source file for vdc4 driver functions. vdc4_api.h header file including the prototype declarations for the vdc4 driver calls and definitions of constants. vdc4_clk.c source file for checking panel clock and software reset. vdc4_int.c source file interrupt handlers. vdc4_local.h header file including local definitions. vdc4_para.c source file checking arguments. vdc4_reg.c source file controlling registers. vdc4_user.h header file for compilation option. th is d r i v er requ ires ex tern al heade r files as below. table 3 exte rnal file dep e nden c ies file name des c ription typedefine.h header file including the ty pedef declarations for the basic types. iodefine.h header file including io definitions. 1.4 program size and section table 4 s h ows program size and sec tion u s ed b y th e vdc4 driv er. table 4 program size a nd section "r enesas su pe rh r i sc e n gi n e st an dar d t o o l chai n 9. 4. 1. 0" "sp e ed & size o p tim iza tio n en ab led " t y pe section nam e size [b y t e] des cription p_vdc4 10.3k (14.4k) program area c_vdc4 0.9k (1.0k) constant area rom d_vdc4 40 (40) initialized data area ram b_vdc4 204 (204) uninitialized data area note: prog ram si ze does n ot incl ude vram si ze an d input video buffer size. value s in the parenthe se s are p r og ram size wh en pa ramete r che c king i s define d.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 5 of 105 apr 18, 2013 1.5 layer and surface vdc 4 has t h re e layers (gra phics plane ) . this driver uses th e se layers as gra phics res o urce and creates t h ree graphics surfaces a n d one vide o s u rfac e. gra phics surface 1 a n d vi deo s u rface a r e m u tually exclusive, beca use both surfaces us e layer 1 as res o urce . t h us, t h ose surface s ca n not be create d sim u ltaneously . the features of vdc4 m odule are im plem ented in this dri v e r by controlling the s u rfaces. layer 1 layer 2 layer 3 display image graphics (1) / video graphics (2) graphics (3) figure 1 la y e r and surface
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 6 of 105 apr 18, 2013 1.6 state transitions all surfaces ha ve a state. the state tran sitions occ u r whe n a pa rticular api func tion is use d . the state tra n sition of the surface is shown bel o w. undef init ready run status vdc4_initialize v d c 4_g r ap h i cs c r eat es u r f ace & vdc4_videocreatesurface v d c 4_g r ap h i cs s t ar t s u r f ace & vdc4_videostartsurface vdc4_terminate vdc4_stopsurface vdc4_destroysurface api function note: the state of the surface is indep endent of each other with the excepti on that the states of all surfaces are changed by vdc4_initialize or vdc4_terminate. figure 2 vdc4 driv er st ate tr ansitio ns
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 7 of 105 apr 18, 2013 1.7 interrupt h a ndler int e r r upt ha ndl ers a re i m pl em ent e d i n t h i s d r i v er. tab l e 5 sh ows th e list of in terrup t h a ndlers. table 5 inte rrupt handle r interrup t ve ctor interrup t so urce number addr ess interrupt handler vi_vsync vsync sign al before scalin g 171 0x0000 02a c ~ 0x0000 02af void vdc4_int_vi_vsync( void ) ; lo_vsync vsync signal after scaling 172 0x0000 02b0 ~ 0x0000 02b3 void vdc4_int _lo_vsy nc( void ) ; vsyncerr missing vsync signal for scaling 173 0x0000 02b4 ~ 0x0000 02b7 void vdc4_int _vsynce rr( void ) ; vline specified line signal for panel output 174 0x0000 02b8 ~ 0x0000 02bb void vdc4_int _vline( void ) ; vfield field end signal for recording function 175 0x0000 02b c ~ 0x0000 02bf void vdc4_int _vfield( voi d ) ; vbuferr1 frame buffer write overflow signal 176 0x0000 02 c0 ~ 0x0000 02 c3 void vdc4_int _vbuferr1 ( void ) ; vbuferr2 gra phi cs 1 frame buffer re ad und erflo w signal 177 0x0000 02 c4 ~ 0x0000 02 c7 void vdc4_int _vbuferr2 ( void ) ; vbuferr3 gra phi cs 2 frame buffer re ad und erflo w signal 178 0x0000 02 c8 ~ 0x0000 02 cb void vdc4_int _vbuferr3 ( void ) ; vbuferr4 gra phi cs 3 frame buffer re ad und erflo w signal 179 0x0000 02 cc ~ 0x0000 02 cf void vdc4_int _vbuferr4 ( void ) ; if it is n ecessary to use vdc 4 in terrup ts, functio n s i n tabl e 5 sh o u l d be de fi ne d as i n t e rr u p t ha n d l e r. i f ap i f u nct i o n p r ov id ed b y os or equ a l with it to d e fin e th e in terrup t h a ndler is no t u s ed , in terru p t h a n d l er in tabl e 5 s h o u l d be set t o appropriate ent r y in t h e vector table (see exa m ple below). 1 /* vector table example */ 2 /* register the interrupt handler in the vector table */ 3 void (*vectortable[])( void ) = { 4 ? 5 vdc4_int_vi_vsync, 6 vdc4_int_lo_vsync, 7 vdc4_int_vsyncerr, 8 vdc4_int_vline, 9 vdc4_int_vfield, 10 vdc4_int_vbuferr1, 11 vdc4_int_vbuferr2, 12 vdc4_int_vbuferr3, 13 vdc4_int_vbuferr4, 14 ? 15 } ;
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 8 of 105 apr 18, 2013 1.8 compilation s w itches thi s dri v er has com p i l a t i on s w i t c hes i n vdc 4_ use r. h . 1.8.1 parameter checking whe n _vdc4 _parameter_check is de fined, the driver chec ks t h e argu m e nt s of d r i v er f u nct i o n s . a r g u m e nt s are c h e c k ed and err o r co d e s r e tu rn e d if th ere a r e errors. for e r ror codes, see 2. 2 er ro r and 2. 3 ap i fu nct i o n. 1.8.2 interrupt handler definition in t h i s dri v er, s o m e funct i o ns fo r i n t e rr upt ha ndl e rs a re i m plem ent e d (see 1.7 in terrup t han d ler an d tabl e 5 ) . t o use t h ese f u nct i o n s f o r i n t e rr u p t f unct i o n t h at wi l l gua rant ee re gi st er val u es b e fo re a n d aft e r pr ocessi ng , _vdc4_define_inthdl s h o u l d be de fi n e d. wh en _vd c4_define_inthdl i s de f i ned, t h e decl ar at i on " # p r a g m a in terru p t" is enab led and th e co m p iler assu mes th at th e fu n c tio n s i n tabl e 5 a r e i n t e r r upt fu nct i o ns. if so m e fun c tion th at supp ort in terrup t fun c tion (e.g. th e api f u nct i o n p r ov i d ed by os t o r e gi st er t h e i n t e rr upt ha ndl e r) is u s ed for th e reg i stration o f th e in terrup t h a n d l er, _vdc4 _define_inthdl sh o u l d b e u nde fi ne d. 1.9 restriction 1.9.1 reserved word to se pa rat e f r o m t h e ot he r pr o g ram , t h e pre f i x ?v dc 4 ? i s a p pend e d t o t h e ap i nam e s, vari abl e nam e s and ot her sy m b o l s in t h is driv er. th erefo r e, the n a m e s started with ?v dc 4 ? (i n b o t h up pe rcase a n d lo wercase letters) shou ld no t be use d i n t h e ot he r pr og ram . 1.9.2 register update a lo t of vdc 4 reg i sters are up d a ted at th e ri sing edg e o f th e vsy n c sign al. th erefo r e, it will tak e a p eri o d of tim e eq ual to 1 vsyn c p eri o d ti m e at th e m o st to reflect th e set v alues. 1.9.3 reentranc y api fun c tio ns i n th is driv er are no t reen tran t. if api fu n c tio n s are called asyn chrono u s ly fro m m u ltip le t a sk s or in terrup t service routine s, it can cause une xpected be havi or. pay at t e n tio n to wh ere and wh en api fun c tio ns are called .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 9 of 105 apr 18, 2013 2. api 2.1 common definition 2.1.1 t y pedef in th is d r i v er, d a ta typ e s i n table 6 are use d . t h ese declara tions a r e defi n e d i n t y pede fi n e .h (see 1. 3 file con f iguratio n). table 6 t y p edef decla ra t ions t y pedef t y pe _sbyte signed char _ubyte unsigned char _sword signed short _uword unsigned short _sint signed int _uint unsigned int _sdword signed long _udword unsigned long _sqword signed long long _uqword unsigned long long 2.1.2 definition of enumeration constants the vdc4_on off enum eration de fines on and off. typedef enum { vdc4_off = 0, vdc4_on = 1 } vdc4_onoff ; enum value des c ription vdc4_off 0 off vdc4_on 1 on the vdc4_ed ge en um erat i on defi nes t h e e dge o f t h e si g n a l . typedef enum { vdc4_edge_rising = 0, vdc4_edge_falling = 1 } vdc4_edge ; enum value des c ription vdc4_edge_rising 0 rising edge of the signal vdc4_edge_falling 1 falling edge of the signal the vdc4_la yerid enum e r ation de fines the s u rface id. typedef enum { vdc4_surface_graphics_1 = 0, vdc4_surface_graphics_2 = 1, vdc4_surface_graphics_3 = 2, vdc4_surface_graphics_num = 3, vdc4_surface_video_1 = 3,
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 10 of 105 apr 18, 2013 vdc4_surface_video_num = 1, vdc4_surface_num = 4 } vdc4_layerid ; enum value des c ription vdc4_surface_graphics_1 0 graphics 1 surface id vdc4_surface_graphics_2 1 graphics 2 surface id vdc4_surface_graphics_3 2 graphics 3 surface id vdc4_surface_graphics_num 3 number of graphics surfaces vdc4_surface_video_1 3 video surface id vdc4_surface_video_num 1 number of video surfaces vdc4_surface_num 4 number of surfaces 2.1.3 rectangle structure thi s dri v er has som e t i m i ng d a t a ex presse d by a rectangle, s o structure vd c4_arearect that express rectangle is d e f i n e d as show n in figu r e 3. hs vs vw hw rectangle figure 3 re ctan gle da ta me m b ers of t h e struct ure vd c4_arearect are s h ow n be l o w. typedef struct { _uword hs ; _uword hw ; _uword vs ; _uword vw ; } vdc4_arearect ; ty pe member name des c ription _uwo rd h s ho rizontal sta r t pos it io n [ pix el cloc k cy cl es] _uword hw horizontal widt h [pixel clock cycles] _uword vs vertical start position [lines] _uwo rd vw height ( vertical width ) [lines]
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 11 of 105 apr 18, 2013 2.2 error a p i fun c tio n calls r e tu rn s an er ro r cod e . th e er ror co d e s are show n in table 7. table 7 error code lis t error value des c ription vdc4_err_none 0 normal end. vdc4_err_surface_bad 0x2000 surface e rro r. the fun c tion can not be cal l ed with the su rfa c e. vdc4_err_surface_status 0x2001 surface e rro r. the fun c tion can not be cal l ed in a cu rre nt state. vdc4_err_param_range 0x4001 param eter error. the spe c ified value is out of rang e. vdc4_err_param_undef 0x4002 param eter error. null shoul d not be specified. vdc4_err_param_invalid 0x4003 param eter error. the spe c ified para m et er is invalid. vdc4_err_param_others 0x4000 parameter error. others. vdc4_err_system_pnlclk 0x8000 system erro r. the a bno rm ality of the p anel clo ck i s dete c ted. param e ter errors are return ed fro m api fun c tio n call on ly wh en th e co m p il atio n switch o f p a ram e ter ch eck i ng is d e fin e d.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 12 of 105 apr 18, 2013 2.3 api function table 8 s h ows the states in which eac h drive r call can be made. table 8 state matrix states driv er call name surface unde f init rea d y run vdc4_initiali z e all surfa c e ok ng ng ng vdc4_te r mi nate all surfa c e ng ok ng ng video ng vdc4_g rap h i cscreatesu r f a ce graphics1/2/3 ng ok ng ng video ok vdc4_vide o c reatesu r face graphics 1/2/3 ng ng ng ng vdc4_ d e s troysurface all surfa c e ng ng ok ok vdc4_ r egi st callb ackf un c all surfa c e ng ok video ng vdc 4_g rap h i cssta rtsurfa c e graphics 1/2/3 ng ng ok ng video ok vdc4_vide o s tartsurface graphics 1/2/3 ng ng ng ng video ng vdc4_g rap h i csch ang epa r am graphics 1/2/3 ng ng ng ok video ok vdc4_vide o c ha ngep ara m graphics 1/2/3 ng ng ng ng vdc4_stops urfa ce all surfa c e ng ng ng ok video ok gra phi cs 1 ok vdc4_imag e c olo r mat r ix graphics 2/3 ng ng ng ng video ok vdc4_vide o n oi se red ucti on graphics 1/2/3 ng ng ng ng video ok ok gra phi cs 1 ok ok vdc4_imag e e nhan cem e n t gra phi cs 2/3 ng ng ng ng video ng ng gra phi cs 1 ng ng vdc4_g rap h i csal phable n ding graphics 2/3 ng ng ok ok video ng ng gra phi cs 1 ng ng vdc 4_g rap h i cs ch rom a k e y gra phi cs 2/3 ng ng ok ok video ng ng vdc4_g rap h i css etcl ut graphics 1/2/3 ng ng ok ok vdc4_displaycalibration all surface ng ok vd c4 _d isp l ayse tg a mmac o r r e c tio nt ab le all s u r fac e n g ok vdc4_swit c hvsyn c all surfa c e ng ok vdc4_checkclock all surface ok ng vd c4 _r es e t all s u r f ac e o k ng
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 13 of 105 apr 18, 2013 2.3.1 vdc4_initia lize syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _in itialize ( co nst vdc4_initattr *attr, void (*init_func)( _udword ), _udword u s e r _n um ) ; parameters ? [in]c o ns t vdc 4 _initattr *attr ? [in]v oid (*init_ f unc )( _ u d w or d ) ? [in]_udword user_num initialization a ttribute para m eter pointer to the use r-d efined function user-defin ed numb er retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_param_ra n ge vdc4_err_param_undef vdc4_err_param_inv alid vdc4_err_param_others erro r co de no rmal en d. param e ter e r ror. out of ra nge. param e ter e r ror. undefin e d . param e ter e r ror. inv a lid pa ramete r. param e ter e r ror. othe r s . descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the s p ecifie d user-define d fun c tio n is ex ecuted . ? th e vdc4 driv er in tern al v a riab les are i n itialized . ? th e vdc4 registers are i n itialized . ? th e i n itializat i o n fo r lcd p a n e l driv e is pe rform e d . ? the o p erat i o n of t h e pa nel clock i s e n abl e d. ? the vdc4 i n terrupts are e n a b led. ? all states of surfaces ar e t r ansitioned t o ?init?. before vdc 4 d r i v er i n itializa tio n , u s er-d efi n ed fun c tion sp ecified b y ini t_func is called . for informatio n ab ou t th e pr ocess o f user -de f i n e d fu nct i o n , see 3.1 . it is no t always n ecessary to sp ecify th e u s er-d efin ed fun c tio n po in ter. if user-d efi n ed functio n is no t sp ecified , t h e o p e ration stated b e low sho u l d b e p e rfo r m e d b e fo re th is vdc4 d r iv er i n itializatio n . ? sup p l y th e clock to th e vdc 4 . ? set th e vdc 4 i n terrup t lev e ls. ? set i/o p o rt f o r the vdc 4. ? set th e en v i r onmen t sp ecif i c par a m e ter s ( e .g . r e lated t o input v i d e o im ag e o r lcd p a n e l) .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 14 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc 4_initattr * attr in initialization attribute parameter null should not be specified. void (*init_fun c )( _ u d w o r d ) in pointer to the use r-d efined function if ?0? is not specified, u s e r -defined fun c ti on will be call ed with an a r gu ment sp ecifie d by use r-d efined nu mbe r (u ser_nu m). if nece s sary, use r -define d functio n mu st be impleme n ted by the use r . syntax vo id in it_ f u n c ( _ud wo rd us er _n u m ) ; parameters ? [in]_udwo r d user_num user-defin ed numb er retu rn values ? void de scriptio n processing implemented by the user is performed. _u dw or d use r _ num in user-defin ed numb er this p ara met er is u s e d as an argume nt to the use r - defined fun c ti on. this p a ra meter is ig no red, whe n poi nter to the use r -defin ed functio n (i nit_func) is set to ?0?. me m b ers of t h e struct ure vd c4_initattr are s h ow n be l o w. typedef struct { vdc4_vsyncsigsel vsel ; vdc4_syncctrl *sync ; vdc4_panelclocksel panel_icksel ; vdc4_panelclkdcdr panel_dcdr ; _uword tcon_half ; _uword tcon_offset ; vdc4_edge outcnt_lcd_edge ; vdc4_lcdtcontim *outctrl[ vdc4_lcd_tconsig_num ] ; vdc4_lcdoutput *settings ; _udword intenable_1 ; _udword intenable_2 ; } vdc4_initattr ; ty pe member name input / outpu t des c ription vdc4_vsyn c sigsel vs el in vsync sign al output sele ct vdc4_syncc tr l * sy nc in synchroni zati on co ntrol if null is sp ecified, the freque nt vsync signal maskin g and the missing v s ync sign al compe n sation will be set to t u rn off. vdc4_panel clocksel panel _icksel in panel cl ock source sele ct ? vdc4_l cdpanel_ c lks e l_img:
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 15 of 105 apr 18, 2013 video imag e clo ck (video _x1) ? vdc4_lcdpanel_clks e l_ext: external c lock (lcdext_clk) ? vdc4_lcdpanel _ c lks e l_peri: periph eral clo ck 1 ? vdc4_lcdpanel_c lks e l_img_ d v: video imag e clo ck (dv_ cl k) vdc4_p anel clkdcdr panel _d cd r in panel cl ock freque ncy division ratio ? vdc4_l cdpanel_ c lk div_1_1: 1/1 ? vdc4_l cdpanel_ c lk div_1_2: 1/2 ? vdc4_l cdpanel_ c lk div_1_3: 1/3 ? vdc4_l cdpanel_ c lk div_1_4: 1/4 ? vdc4_l cdpanel_ c lk div_1_5: 1/5 ? vdc4_l cdpanel_ c lk div_1_6: 1/6 ? vdc4_l cdpanel_ c lk div_1_7: 1/7 ? vdc4_l cdpanel_ c lk div_1_8: 1/8 ? vdc4_l cdpanel_ c lk div_1_9: 1/9 ? vdc4_l cdpanel_ c lk div_1_1 2: 1/12 ? vdc4_l cdpanel_ c lk div_1_1 6: 1/16 ? vdc4_l cdpanel_ c lk div_1_2 4: 1/24 ? vdc4_lcdpanel_clkdiv_1_32: 1/32 _u wo rd tcon_ half in tco n refe re nce timin g , 1/2fh timing the cl ock cy cle cou nt from the hsyn c ri si ng edg e. 0x0000 ~ 0x0 7ff _u wo rd tcon_ offset in tco n refe re nce timin g , offset hsyn c si gnal timing the cl ock cy cle cou nt from the hsyn c ri si ng edg e. 0x0000 ~ 0x0 7ff vdc4_e dge outcnt_l c d _e dge in output pha se control of lcd_ data23 t o lcd_ data 0 pin ? vdc4_edge _ rising: ri sing edg e ? vdc4_edge _ falling: falling ed ge vdc 4 _lcdtc ontim * outctrl[ vdc4 _lcd_ tconsig_num ] in lcd tcon ti ming setting ? outc t rl[vdc4_lcd_tconsig_stva_vs]: stva / v s ? outc t rl[vdc4_lcd_tconsig_stvb_ve]: stvb / v e ? outctrl[vdc4 _lcd_ tconsig_sth_s p _hs]: sth / sp / hp ? outctrl[vdc4 _lcd_ tconsig_stb_lp _he]: stb / lp / he ? outctrl[vdc4 _lcd_ tconsig_cpv_g c k]: cpv / gck ? outctrl[vdc4 _lcd_ tconsig_pola]: pola ? outctrl[vdc4 _lcd_ tconsig_polb]: polb ? outctrl[vdc4 _lcd_ tconsig_de]: de the settings of unne ce ssa r y sign al sh o u ld be set to null. vdc 4 _lcdout put * set t i ng s in lcd output cont rol null shoul d not be sp ecifi ed. _u dw or d intenable_ 1 in interru pt ena ble bits 1, int 0 - int 7 specify the in terru pt to be use d . to use more tha n one type of interru pt, the or sh ould b e take n to spe c i f y the value.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 16 of 105 apr 18, 2013 ? vdc4_int _b it_no n e: none ? vdc4_int_b it_vi_vsync: vi_vsync ? vdc4_int_b it_lo_vsync: lo_vsync ? vdc4_int_b it_vsynce rr: vsyncerr ? vdc4_int _b it_vline: vline ? vdc4_int _b it_vfield: vfield ? vdc4_int _b it_vbuferr1: vbuffe r1 ? vdc4_int _b it_vbuferr2: vbuffe r2 ? vdc4_int _b it_vbuferr3: vbuffe r3 _u dw or d intenable_ 2 in interru pt ena ble bits 2, int 8 if nec ess a ry, s p ec ify vbuffer4 interrupt. ? vdc4_int _b it_no n e: none ? vdc4_int_bit_vbuferr4: vbuffer4 me m b ers of t h e struct ure vd c4_vsyncsigsel ar e show n b e l o w. typedef struct { vdc4_onoff freerunvsync ; _uword res_fv ; _uword res_fh ; } vdc4_vsyncsigsel ; ty pe member name input/ outpu t des c ription vdc 4 _onoff free ru nvsyn c in free -runni ng vsync o n /o ff ? vdc4_of f ? vdc4_o n _u wo rd re s_fv in free -runni ng vsync p erio d setting vsync p erio d = (res_fv + 1) x hsync pe ri od 0x0000 ~ 0x0 7 ff [lines] this p a ramet e r is i gno re d, whe n free-runnin g vsyn c (free r unv sync) is set to vdc4_o ff. _u wo rd re s_fh in hsyn c pe rio d setting hsyn c pe rio d = (res_fh + 1 ) / pixel clock f r eq uen cy 0x0000 ~ 0x0 7ff [pixel clo ck cycle s ] me m b ers of t h e struct ure vd c4_syncctrl are s h ow n be l o w. typedef struct { vdc4_onoff res_vmask_on ; _uword res_vmask ; vdc4_onoff res_vlack_on ; _uword res_vlack ; } vdc4_syncctrl ; ty pe member name input/ outpu t des c ription vdc4 _onoff r e s _ vmas k_on in rep eated v sync sig nal ma ski ng control ? vdc4_of f ? vdc4_o n _uwo rd re s_v m a sk in rep eated v sync sig nal ma ski ng pe rio d re s_vma sk should be spe c ified in term s of 128 pixel clo ck cy cle s .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 17 of 105 apr 18, 2013 vdc 4 _onoff r e s _ vlac k_on in missing vsyn c sig nal comp ensation ? vdc4_of f ? vdc4_o n _u wo rd re s_v l a ck in missing - sync comp en sati ng pul se outp u t wait time re s_vla ck sh ould be spe c ified in terms of 128 pixel clock cycles. me m b ers of t h e struct ure vd c4_lcdtcontim are s h own below. typedef struct { _uword tcon_hsvs ; _uword tcon_hwvw ; vdc4_lcdtconpolmode tcon_md ; _uword tcon_hs_sel ; _uword tcon_inv ; vdc4_lcdtconpin tcon_pin ; vdc4_edge outcnt_edge ; } vdc4_lcdtcontim ; ty pe member name input/ outpu t des c ription _u wo rd tcon_ hsv s in signal pul se start po sition first cha ngin g timing. starts pul se out put after the time spe c ified by the value of tcon_h svs. 0x0000 ~ 0x0 7ff [pixel clo ck cycle s o r 1 / 2fh cycle s ] this pa ram eter sh ould be gre ater than or equ al to 1 whe n tcon_ md of pola/polb sign al is not set to norm a l mod e . _u wo rd tcon_ hwv w in pulse width seco nd cha nging timin g . outputs a pulse of the duration of the value of tco n_h wvw. 0x0000 ~ 0x0 7ff [pixel clo ck cycle s o r 1 / 2fh cycle s ] vdc 4 _lcdtc onpolmode tcon_ md in pola/polb sign al gen era t ion mode sel e ct ? vdc 4_l c d _ t co n_po l m d_ no rma l: no rmal mo de ? vdc4_l cd_ tco n_po l m d_ 1x1rev : 1x1 reverse mode ? vdc4_l cd_ tco n_po l m d_ 1x2rev : 1x2 reverse mode ? vdc4_l cd_ tco n_po l m d_ 2x2rev : 2x2 reverse mode _u wo rd tcon_ hs_sel in ho rizontal si g nal ope ratin g referen c e sel e ct ? 0 : hs ync s i gna l r e fe r e n ce ? 1: offset hsy nc si gnal refe ren c e offset value is spe c ified b y the tcon_ offset membe r of the vdc4_i nitattr structu r e. _u wo rd tcon_i nv in polarity inversion cont rol o f signal ? 0: not inverted ? 1: inverted vdc 4 _lcdtc onpin tcon_ pin in output pin for lcd d r iving sign al ? vdc 4_l c d _ t co n_pin _ no n: non e ? vdc4_l cd_ tco n_pin_ 0: lcd_t c o n 0 ? vdc4_l cd_ tco n_pin_ 1: lcd_t c o n 1 ? vdc4_l cd_ tco n_pin_ 2: lcd_t c o n 2
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 18 of 105 apr 18, 2013 ? vdc4_l cd_ tco n_pin_ 3: lcd_t c o n 3 ? vdc4_l cd_ tco n_pin_ 4: lcd_t c o n 4 ? vdc4_l cd_ tco n_pin_ 5: lcd_t c o n 5 ? vdc4_l cd_ tco n_pin_ 6: lcd_t c o n 6 vdc4_e dge outcnt_ edg e in output pha se control of sig nal ? vdc4_edge _ rising: ri sing edg e ? vdc4_edge _ falling: falling ed ge this parameter is not referenced when the output pin (tcon_pin) is set to vdc4_lcd_tcon_pin_non. note: specify tcon _ hsvs a nd tco n_h wvw in pi xel clock cy cl es when the sign al is u s ed as ho rizontal signal. specify tcon _ hsvs a nd tco n_h wvw in 1/ 2fh cycl es when the si gna l is use d as v ertical sig nal. it is not necess a ry to set all me m b er of t h e st ruct ure vdc4_ lcdtcontim . mem b ers that m u st be set are differe n t depe n d i n g on t h e eac h si gnal . table 9 stru ctur e v dc4_lcdtco ntim and timing signal signal member stva stvb sth stb cpv pola polb de tcon_ hsv s r r r r r r r i tcon_ hwv w r r r r r r r i tc on_md i i i i i r r i tcon_ hs _s el i i r r r r r i tcon_i nv r r r r r r r r tcon_ pin r r r r r r r r outcnt_ edg e r r r r r r r r note: ?r? in the tabl e mean s that the membe r i s refe rred. ?i? in the table mean s that the memb er i s ignored. me m b ers of t h e struct ure vd c4_lcdoutput are s h ow n bel o w. typedef struct { vdc4_arearect res_f ; vdc4_onoff out_endian_on ; vdc4_onoff out_swap_on ; vdc4_lcdoutformat out_format ; vdc4_lcdclkfrqsel out_frq_sel ; _uword out_dir_sel ; vdc4_lcdclkphase out_phase ; } vdc4_lcdoutput ; ty pe member name input/ outpu t des c ription vd c 4 _ a r e ar ec t re s_f in full-scre en e nable cont rol see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. re s_f.hs sh o uld be 16 clo ck cy cle s or greater. re s_f . h s + re s _ f . h w sh ould be 201 5 clo c k cy cl es o r le ss. re s_f . v s sh o u ld be 4 li n e s o r gr eat e r . re s_f . v s + re s_f.vw sh o uld be 20 39 li nes o r le ss. vdc 4 _onoff out_en dian _o n in bit endian ch ange o n /of f control ? vdc4_of f ? vdc4_o n vdc4_onoff in b/r signal swap on/off control
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 19 of 105 apr 18, 2013 out_swa p_o n ? vdc4_of f ? vdc4_o n vdc 4 _lcdout f or mat out_form a t in lcd output format sele ct ? vdc4_l cd_ o utf o rmat_rgb888: rgb8 88 ? vdc4_l cd_ o utf o rmat_rgb666: rgb6 66 ? vdc4_l cd_ o utf o rmat_rgb565: rgb5 65 ? vdc4_lcd_outform at_serial_rgb: serial rgb vdc 4 _lcdc l kfr q sel out_frq _sel in clo ck f r equ e n cy co nt rol ? vdc4_l cd_ serial_clkfrq _3: x 3, se rial rgb ? vdc4_l cd_ serial_clkfrq _4: x 4, se rial rgb this p ara met er is referen c ed only wh e n lcd outpu t format select (out_format) is set to serial rgb. _u wo rd out_di r_ sel in scan di re ctio n sele ct ? 0: forward scan ? 1: reverse scan this parameter is referenced only when lcd output format select (out_format) is set to serial rgb. vdc 4 _lcdc l kphase out_ph ase in clo ck ph ase adjustme nt for serial rgb output triple spe ed mode (x3 ) ? vdc4_l cd_ serial_clkphase_0: 0[clk] ? vdc4_l cd_ serial_clkphase_1: 1[clk] ? vdc4_l cd_ serial_clkphase_2: 2[clk] quad ru ple sp eed mo de (x4 ) ? vdc4_l cd_ serial_clkphase_0: 0[clk] ? vdc4_l cd_ serial_clkphase_1: 1[clk] ? vdc4_l cd_ serial_clkphase_2: 2[clk] ? vdc4_l cd_ serial_clkphase_3: 3[clk] this parameter is referenced only when lcd output format select (out_format) is set to serial rgb.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 20 of 105 apr 18, 2013 2.3.2 vdc4_terminate syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _t ermin a te( voi d (*quit_fu nc)( _udwo rd ), _udword u s e r _n um ) ; parameters ? [in]void (*quit _ func)( _ udwo rd ) ? [in]_udword user_num pointer to the use r-d efined function user-defin ed numb er retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus erro r co de no rmal en d. surface erro r. illegal state. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the s p ecifie d user-define d fun c tio n is ex ecuted . ? the o p erat i o n of t h e pa nel cl ock i s di sabl ed . ? the vdc4 i n terrupts are disa bled. ? all states of surfaces ar e t r ansitioned t o ?undef?. aft e r v d c 4 dr i v er t e rm i n at i on, use r - d efi n ed f unct i o n s p eci fi ed by quit_ func is called. fo r in form at i o n abou t th e pr ocess o f user -de f i n e d fu nct i o n , see 3.2 . it is no t always n ecessary to sp ecify th e u s er-d efin ed fun c tio n po in ter. if user-d efi n ed functio n is no t sp ecified , t h e ope rat i o n st at ed bel o w s h oul d be pe rf orm e d aft e r t h i s v dc 4 dri v er t e rm i n at i on. ? halt th e clo c k supp l y to th e vdc4. ? clear th e vdc 4 in terru p t lev e ls. ? set th e en v i r onmen t sp ecif i c par a m e ter s ( e .g . r e lated t o input v i d e o im ag e o r lcd p a n e l) .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 21 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription void (*quit_fu nc)( _udword ) in pointer to the use r-d efined function if ?0? is not specified, u s e r -defined fun c ti on will be call ed with an a r gu ment sp ecifie d by use r-d efined nu mbe r (u ser_nu m). if nece s sary, use r -define d functio n mu st be impleme n ted by the use r . syntax vo id q u it_ f un c( _ udw ord us er _n u m ) ; parameters ? [in]_udwo r d user_num user-defin ed numb er retu rn values ? void de scriptio n processing implemented by the user is performed. _u dw or d use r _ num in user-defin ed numb er this parameter is used as an argument to the user- defined function. this parameter is ignored, when pointer to the user-defined function (quit_func) is set to ?0?.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 22 of 105 apr 18, 2013 2.3.3 vdc4_grap h icscreatesurface syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _g rap h icscre atesrufa ce ( vdc4_ laye r id i d , c o ns t vdc 4 _graphics a ttr *attr ) ; parameters ? [in]vdc4_lye r id id ? [in]const vdc4_graphicsattr *attr layer id gra phi cs surf ace attri bute paramete r retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_undef vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. undefin e d . param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the gra p hics s u rface s p ecifie d by id is creat ed. ? the c o lo r fo rm at of the gr a p hics surface is se t. ? the fram e buffer of t h e gra p hics surface is se t. ? the state of the graphics surface specifie d by id is tra n sitioned from ?init? to ?ready?. ? scaling up para m eters are set only when gra phics surface 1 is created. if cl ut 1, cl ut 4 or cl ut 8 c o lor form at is specifie d , it i s neces sary to set clut. if argb1555 c o lor form at is specified, the a l pha value s h ould be specifie d . to set cl ut and t h e alpha value for ar g b155 5 for m at ar e p e rf or m e d by vdc 4_ gra phics setclut (see 2. 3. 1 7) . note t h at gra p hics s u rface 1 and vi deo s u rface are e x clusi v e.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 23 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 1: gra phics surfa c e 1 ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: graphics surface 3 vdc4_ g raphi csattr * attr in gra phi cs surf ace attri bute paramete r null shoul d not be sp ecifi ed. me m b ers of t h e struct ure vd c4_graphicsattr ar e show n b e l o w. typedef struct { vdc4_arearect gr_grc ; vdc4_framebuff buff ; } vdc4_graphicsattr ; ty pe member name input/ outpu t des c ription vdc 4 _ a r e ar ec t gr_ grc in display area see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. gr_ grc.hs sh ould be 1 6 clock cy cle s or g r e ater. gr_ grc.hs + gr_ grc.hw sh ould b e 20 15 clo ck cycl es or less. gr_ grc.h w sh ould b e 3 clo ck cycle s or g r eate r . gr_ grc.vs sh ould be 4 lines or greate r . gr_grc.vs + gr_ grc.vw sh ould be 2 039 lines o r le ss. vdc4 _framebuff buff in gra phi cs fra m e buffer pa rameter mem b ers of t h e struct ure vd c4_framebuff are s h ow n bel o w. typedef struct { _sint gr_bst_md ; void *gr_base ; void *buff_2nd ; _uword gr_ln_off ; _sint gr_ln_off_dir ; _uword gr_flm_loop ; vdc4_grformat gr_format ; vdc4_onoff gr_endian_on ; _udword bg_color ; vdc4_graphicsext *graex ; } vdc4_framebuff ; ty p e member name input/ outpu t des c ription _sint gr_ bst_m d in fram e buffer burst tran sfer mode ? 0: 32-byte tra n sfe r ? 1: 128-byte transfe r void * g r _b as e in fram e buffer base add re ss null mu st n o t be spe c ifie d.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 24 of 105 apr 18, 2013 void * buff_2nd in 2nd fram e b uffer ba se a ddress (o nly doubl e buffering mode ) w h en s i ng le b u ffe r mo de , n ul l mus t be s p ec ifie d . for mo re info rmation a bou t memory allo cation fo r th e s e c o nd buffer, s ee figu re 4 . _u wo rd gr_l n_off in fram e buffer line offset ad dre s s [bytes] whe n gr_b st_md is set to 0: a multiple of 32 when gr_bst_md is set to 1: a multiple of 128 _sint gr_l n_off_di r in line offset ad dre s s dire ctio n of the frame buffer ? 0: increm ents the address by the line offset add re ss. ? 1: de creme nts the add re ss by the line offset add re ss. if gr_ln_off_dir is set to ?1?, the displayed image will be flipped vertically. _u wo rd gr_flm_l oop in num ber of lines whe n rea ding the add re sse s rep eatedly the num be r of lines is g r _ f lm_loop + 1. 0x0000 (0) ~ 0x03ff (102 3) if this feature is not necessary, it?s recommended that gr_flm_loop is set to a large value enough (e.g. 1023). vdc 4 _gr f or mat gr_fo r mat in gra phi cs format of the frame buffer rea d sign al ? vdc4_format_rgb565: rgb565 ? vdc4_format_rgb888: rgb888 ? vdc4_fo r mat_argb 1 555: argb1 555 ? vdc4_fo r mat_argb 4 444: argb4 444 ? vdc4_fo r mat_argb 8 888: argb8 888 ? vdc4_fo r mat_clut 8: clut8 ? vdc4_fo r mat_clut 4: clut4 ? vdc4_fo r mat_clut 1: clut1 ? vdc4_format_ycc422: ycbcr422, only for graphics 1 vdc 4 _onoff gr_ endi an_ on in endian control of data rea d from buffer (o n/off) ? vdc4_of f ? vdc4_on _u dw or d bg_ colo r in backgroun d color whe n gr_fo r mat is set to cl ut1, cl ut4, clut8 o r ycb c r4 22, specify value i n rgb8 88 format. except as n o ted ab ove, spe c ify value in the sam e colo r form at specifie d by gr_format. lsb-justified format. see figure 5 for the background color format. vdc4_ g raphi csext * graex in gra phi cs extensi on pa ram eter this is valid only when graphics 1 is specified. if it is unnecessary, graex can be null.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 25 of 105 apr 18, 2013 whe n d o u b l e b u f feri n g i s pe rf orm e d, not e t h e l i m i t a tions stated bel o w about the second fram e buffer ( b uff_2nd ) m e m o ry (see fi gu re 4). ? the sec o nd b u ffe r has t h e sa m e wi dt h ( gr_ arc.hw ), hei ght ( gr_arc. vw ) a n d line of fset ( gr_ln_ off ) as t h e first bu ffe r has. ? the sec o nd f r a m e bu ffe r s h o u l d be all o cat ed behi nd t h e fi rst b u f f er . ? th e add r ess off s et b e t w een tw o fr am e b u ffer (fr a m e o f f s et) shou ld b e less th an ? 0x0 080 000 0? ( 8 .0 m byte) . ? the a d dress offset bet w een two fram e buffe r ( fram e of fs et) sh o u ld be a s f o llow s : ? whe n gr_bs t_md (fram e b u f fer bu rst transfer m o d e) is set to 0 : a m u ltip le o f 32 ? whe n gr_bs t_md is set to 1 : a m u ltip le o f 12 8 buff_2nd gr_base gr_ln_off gr_arc.hw gr_arc.vw frame offset a. memory map b. data arrangement frame buffer start address 2nd. frame buffer start address figure 4 me mor y allocation and da ta arrang eme nt for the 2 nd buf f er
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 26 of 105 apr 18, 2013 background color r (8bits) g (8bits) b (8bits) 0x00 (8bits) ms b ls b r (5bits) g (6bits) b (5bits) 0x00 (16bits) 0x00 (16bits) r (5bits) g (5bits) b (5bits) a (1bit) 0x00 (16bits) r (4bits) g (4bits) b (4bits) a (4bits) r (8bits) g (8bits) b (8bits) a ( 8bit s ) rgb565 argb1555 argb4444 argb8888 rgb888, clut8, clut4, clut1, ycbcr422 note: alpha value in argb1555, argb4444 and argb8888 format has no effect on the background color. figure 5 ba ckgrou nd color setting me m b ers of t h e struct ure vd c4_graphicsext ar e show n b e l o w. typedef struct { vdc4_yccswapformat gr_ycc_swap ; vdc4_yccexchgmode gr_cnv444_md ; _uword gr_in_hw ; _uword gr_in_vw ; vdc4_interpolation res_interpotyp ; vdc4_onoff adj_sel ; } vdc4_graphicsext ; ty pe member name input/ outpu t des c ription vdc4_y ccswapfo r mat gr_y cc_swa p in cont rol s swappin g of d ata read fro m buffer in the ycb c r4 22 format x vdc4_yccs w ap_cby0cry 1: cby0cry1 x vdc4_yccs w ap_y0c by1cr: y0cby 1 cr x vdc4_yccs w ap_cry0 cby1: cry0cby1 x vdc4_yccs w ap_y0cry1cb: y0cry 1 cb x vdc4_yccs w ap_y1cry0cb: y1cry 0 cb x vdc4_yccs w ap_cry1 cby0: cry1cby0 x vdc4_yccs w ap_y1c by0cr: y1cby 0 cr x vdc4_yccs w ap_cby1cry 0: cby1cry0 this i s refere nced o nl y when graphi cs fo rm at (gr _form at) is set to ycbc r4 22. and this parameter is valid only when endia n co ntrol (g r_e ndi an_o n) is set to vdc4_o n. vdc4_y ccexchgmo de gr_ c nv4 44_m d in interpol ation mode fo r ycb c r4 22 to ycb c r444 conve r sion x vdc4_ycc_ 444_ ho ld: hold inte rp ol ation x vdc4_ycc_ 444_ave rage: average interp olation this i s refere nced o nl y when graphi cs fo rm at
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 27 of 105 apr 18, 2013 (gr_form at) is set to ycbcr422. _u wo rd gr_i n_h w in ho rizontal wi dth of grap h i cs 1 i nput to scale r [pixel clo ck cy cle s ] when gr_in_hw is shorter than the horizontal width of display area specified by gr_grc and graphics format (gr_format) is set to rgb565, rgb888 or ycbcr422, enlargement process is done. _u wo rd gr_i n_vw in vertical width of graphi cs 1 input to scal e r [line s ] when gr_in_vw is shorter than the vertical width of display area specified by gr_grc and graphics format (gr_format) is set to rgb565, rgb888 or ycbcr422, enlargement process is done. vdc4_inte r p o l a tion re s_inte rpoty p in interpol ation mode sele ct ? vdc4_inte r polatio n _ho l d: hold interpol ation ? vdc4_inte r polatio n _linear: linea r interpo l ation this is referenced only when enlargement process is done. vdc 4 _onoff adj_ s el in mea s ures to decre ase th e influen ce b y folding pix e ls (o n/off) ? vdc4_of f ? vdc4_o n this is referenced only when enlargement process is done.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 28 of 105 apr 18, 2013 2.3.4 vdc4_vide o createsurface syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _vi deo createsruface ( vdc4_ layeri d id , const vdc4_vi deoattr *attr ) ; parameters ? [in]vdc4_lye r id id ? [in]const vdc4_videoattr *attr layer id video surfa c e attribute parameter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_undef vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. undefin e d . param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the vide o s u rface specifie d by id is create d . ? scal i ng a n d rot a t i on param e t e rs a r e set . ? ip c o nve rsi o n and fi el d det e r m i n at i on si g n a l (r es _fl d _ d l y _ s el) are co nt r o l l e d. ? the state of the vide o surface sp ecified b y id is transitio n e d fro m ?in it? t o ?read y?. th e p r o c ed ure for th e scaling an d ro tatio n of the input vide o im age is as be low (see figu re 6) . input output scale down rotation scale up writing to frame buffer frame buffer reading from frame buffer figure 6 scaling and ro tation pro c e ssing flo w as s h ow n i n fi gu re 6, t h e wri t i ng t o fram e bu ffe r i s per f o r m e d bef o re scal i n g u p . t h ere f o r e, i t i s not nec e ssary t o co nsid er th e scaled up size to d ecid e t h e size o f fram e b u f fe r. bu t t h e writing to fram e b u ffe r is p erform ed after ro tatio n . w h en t h e input v id e o im ag e is ro tated b y 90 d e g r ees or 27 0 d e g r ees, w id th and h e igh t ar e ex ch ang e d .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 29 of 105 apr 18, 2013 fi gu re 7 s h ow s t h at t h e re qui r e d si ze of f r am e b u f f er i s cha nge d by scal i n g a n d r o t a t i o n . in t h e t o p o f t h e fi g u re , t h e i m ag e to b e cap t ured is scaled d o wn an d written to fram e b u f fer. en oug h me m o ry is allo cated to fram e b u ffer t o write im age dat a . in t h e b o t t o m of t h e fi g u re, wi dt h a n d hei ght a r e exc h an ge d a f t e r r o t a t i on. t h eref ore , bu ffe r ove rfl ow occurs. it is n ecessary to con s i d er t h e scalin g do wn an d ro tatio n to decide the size of fram e buffer for the im age to be ca ptured. the values of fram e buffer line offset a d dres s ( res_ln_o ff ) a n d f r am e bu ffe r fram e of fset ad d r ess ( r es_flm_off ) are affected by the scaling down and rotation. for res_l n_off and r es_flm_off , see t h e descri ption of t h e structure vdc 4_res_framebuff . frame buffer captured image displayed image scale down rotation scale up buffer overflow wf (width) line offset hf (height) wi hi wr hr note: wi, hi: the width and height of the captured image after scaling down. wr, hr: the width and height of the captured image after rotation. wr is equal to hi, hr is equal to wi. wf, hf: the width and height of the frame buffer. hf is equal to hi but smaller than hr. figure 7 video frame bu ffe r
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 30 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_video_1: video surface vdc4_vi deoa ttr * attr in video surfa c e attribute parameter null shoul d not be sp ecifi ed. me m b ers of t h e struct ure vd c4_videoattr are s h ow n bel o w. typedef struct { vdc4_videotype type ; _sint inp_sel ; _uword inp_fh50 ; _uword inp_fh25 ; vdc4_extinsig *extsig ; vdc4_inpdlay *dly ; vdc4_arearect res ; vdc4_arearect res_p ; vdc4_scalingrot *scalerot ; vdc4_resframebuff frame ; vdc4_videodisplay *disp ; } vdc4_videoattr ; ty pe member name input/ outpu t des c ription vdc4_videot ype type in type of video surfa c e ? vdc4_vide o _type_di splay: dis p lay ? vdc4_vide o _type_re cord: record _sint inp_ sel in input sele ct ? 0: video de co der o utput sig nals ? 1: signals su pplied via the external inp u t pins whe n p anel clo c k source sele ct (pan el _icksel) i s se t to vdc4_lcdpanel_clksel_img in vdc4_initiali z e, inp _ sel sh ou ld be se t to ?0 ?. w h en panel cl o ck sou r ce select is set to vdc4_l cdpanel_ c lks e l_img_vg in vdc4_initiali z e, inp_ sel sh ould be set to ?1?. _uwo rd inp_fh5 0 in vsync sign al 1/2fh pha se t i ming 0x0000 ~ 0x0 3ff [clo ck cycle s ] _uwo rd inp_fh2 5 in vsync sign al 1/4fh pha se t i ming 0x0000 ~ 0x0 3ff [clo ck cycle s ] vdc4_extinsig * extsig in external input signal p a ram e ter whe n input select (i np_ sel ) is set to ?1?, null shoul d not be sp ecifi ed. wh en i n p u t sele ct i s set to ?0?, extsig is igno re d. vdc4_inp dl ay * dly in sync sig nal d e lay adju s tm ent paramete r if it is unne ce ssary, null can b e set. vdc 4 _ a r e ar ec t re s in image area to be ca ptured see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. re s.hs sh ould be 1 6 cl oc k cy cle s o r g re a t e r. re s.h s + re s.hw sho u l d be 20 15 cl o ck cycl es o r l e ss. and re s. hw
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 31 of 105 apr 18, 2013 sho uld be 4 clock cycl es ali gnme nt. re s.vs sh ould be 4 lines o r gre ater. re s.vs + re s.vw sho uld b e 20 39 line s o r le ss. and re s.vw shoul d be 4 lines ali gnm e n t. vd c 4 _ a r e ar ec t re s_p in image outp u t enabl e sig nal see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. re s_p.h s sh ould b e 16 clo ck cycl e s o r greate r . re s_p.h s + res_ p.hw sho uld be 2015 clock cycle s or less. and re s_p.hw sho uld be 4 clo ck cycle s align m en t. res_p.vs should be 4 lines or greater. res_p.vs + res_p.vw should be 2039 lines or less. and res_p.vw should be 4 lines alignment. vdc4_s cali ng rot * scale r ot in scalin g and rotation pa ram eter if it is unne ce ssary, null can b e set. when pointer scalerot is set to null, scaling and rotation parameters shall be set as following table 10. vd c 4 _r es fr ame b u ff frame in video surface frame buffer parameter vdc4_vi deo display * dis p in video surfa c e display pa ra meter null should not be specified when type of video surface (type) is set to display. me m b ers of t h e struct ure vd c4_extinsig are s h ow n be l o w. typedef struct { vdc4_inpformat format ; vdc4_onoff inp_endian_on ; vdc4_onoff inp_swap_on ; vdc4_edge inp_pxd_edge ; vdc4_edge inp_vs_edge ; vdc4_edge inp_hs_edge ; _sint inp_vs_inv ; _sint inp_hs_inv ; _sint inp_f525_625 ; _sint inp_h_edge_sel ; vdc4_inphpos inp_h_pos ; } vdc4_extinsig ; ty pe member name input/ outpu t des c ription vdc4_in p fo rmat format in external input format sele ct ? vdc4_in_f o rmat _rg b 888: rgb8 88 ? vdc4_in_f o rmat _rg b 666: rgb6 66 ? vdc4_in_f o rmat _rg b 565: rgb5 65 ? vdc4_in_f o rmat _bt6 56: bt656 ? vdc4_in_f o rmat _bt6 01: bt601 vdc 4 _onoff inp_e ndia n_o n in external input bit endian ch ange o n /of f control ? vdc4_of f ? vdc4_o n vdc 4 _onoff inp_ swap_ on in external input b/r signal swap o n /off control ? vdc4_of f ? vdc4_o n vdc4_e dge inp_pxd _ed g e in clo ck edg e sele ct for ca pturin g external inp ut video sign als
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 32 of 105 apr 18, 2013 ? vdc4_edge _ rising: ri sing edg e ? vdc4_edge _ falling: falling ed ge vdc4_e dge inp_vs_ed ge in clo ck e dge sele ct for ca pturin g external input vsync sign al ? vdc4_edge _ rising: ri sing edg e ? vdc4_edge_falling: falling edge vdc4_e dge inp_h s_ edg e in clo ck edg e sele ct for ca pturin g external inp u t hsync sign al ? vdc4_edge _ rising: ri sing edg e ? vdc4_edge_falling: falling edge _sint inp_vs_inv in external input vsync si gnal inversi on co ntrol ? 0: not inverted (positive polarity) ? 1: inverted (negative polarity) _sint inp_h s_i n v in external input hsyn c sig nal inversi on co ntrol ? 0: not inverted (positive polarity) ? 1: inverted (negative polarity) _sint inp_f52 5_6 25 in num ber of lines for bt. 656 inp u t of external in put sy st em ? 0: 525 line s ? 1: 625 lines _sint inp_h _ed ge_ sel in hsyn c sig nal referen c e select for bt.656 format of external in put system ? 0: eav ? 1: sav vd c 4 _ i np hp os inp_h _po s in y/cb/y/cr data s t ring s t art timing with res p ec t to hsync refer en c e ? vdc4_inp_h_pos_cby cry: cb/y/cr/y ? vdc4_inp_ h _pos_y crycb: y/cr/y/cb ? vdc 4_inp_ h _pos_ c ry cby: cr/y/c b/y ? vdc4_inp_h_pos_ycbycr: y/cb/y/cr me m b ers of t h e struct ure vd c4_inpdlay are s h ow n bel o w . typedef struct { _uword inp_vs_dly_l ; _uword inp_vs_dly ; _uword inp_hs_dly ; _uword inp_fld_dly ; } vdc4_inpdlay ; ty pe member name input/ outpu t des c ription _u wo rd inp_vs_dly_l in num ber of lines for dela y ing vsync sign al and field differentiatio n signal 0 ~ 7 [lines] _u wo rd inp_vs_dly in vsync sign al delay amo unt 0 ~ 254 [cl ock cycl es] _u wo rd inp_h s_ dly in hsyn c si gnal delay amo unt 0 ~ 254 [cl ock cycl es] _u wo rd inp_fld_ d ly in field differe ntiation sig nal d e lay amou nt 0 ~ 254 [cl ock cycl es]
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 33 of 105 apr 18, 2013 me m b ers of t h e struct ure vd c4_scalingrot are s h own below. typedef struct { vdc4_onoff res_pfil_sel ; vdc4_interpolation res_interpotyp ; vdc4_rotationtype rot ; vdc4_onoff adj_sel ; } vdc4_scalingrot ; ty pe member name input/ outpu t des c ription vdc 4 _onoff res_pfil_sel in prefilter mode select fo r brightne ss sign als (on/of f) ? vdc4_of f ? vdc4_o n vdc4_inte r p o l a tion re s_inte rpoty p in interpol ation mode sele ct ? vdc4_inte r polatio n _ho l d: hold interpol ation ? vdc4_inte r polatio n _linear: linea r interpo l ation vdc4_ r otatio ntype rot in rotation cont rol an d hori z o ntal mirrorin g ? vd c4 _r o t _n or mal : n o r m a l ? vdc4_ r ot_ mirror: ho rizontal mirro r ing ? vdc4_ r ot_ 90_ deg: 90 deg ree rotation ? vdc4_ r ot_ 180_ deg: 18 0 deg ree rota tion ? vdc4_ r ot_ 270_ deg: 27 0 deg ree rota tion vdc 4 _onoff adj_ s el in mea s ures to decre ase the infl uence by the lack of last- input line, folding line s an d folding pixel s (o n/off) ? vdc4_of f ? vdc4_o n this pa ramet er affects the scaling ratio except for the hori z o n tal scale-do w n rati o. in the case of scal e -do w n, mea s ures to decre ase the influen ce by lack of last-in put pixel are al wa ys taken. if settin g s scalin g and ro tatio n p a ram e ters is u n n ecessary and scalerot i s set to null, settin g s can b e o m it ted . in th is case, scalin g and ro tatio n p a ram eters sh all b e set as ta ble 10. table 10 sc aling and ro tation de faul t value parameter de fault valu e res_pfil_sel vdc4_off res_interpotyp vdc4_interpolation_hold rot vdc4_rot_normal adj_sel vdc4_off in this dri v er, c aptured im age size ( res ) and output im age size ( res_p ) a r e com p ared aut o m atically and if necessary, scal i ng pr ocess i ng i s pe rf orm e d. i n c o m p ari s on p r ocess, t h e cha nge o f si ze by rot a t i o n (i . e ., wi dt h an d h e i ght a r e excha n ged) is considere d .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 34 of 105 apr 18, 2013 video image to be captured 90 degree rotation output image res.hw res.vw (height) (width) res_p.vw res_p.hw res.vw res_p.hw res.hw res_p.vw a. b. res_p.hw res_p.vw c. res.hw < res_p.vw res.vw > res_p.hw 90 or 270 degree rotation figure 8 scaling and ro tation fi gu re 8 s h ow s an e x am pl e of scal i n g an d rot a t i on pr ocessi n g . ? a ? i n t h e fi gu re 8, i n put vi deo i m age i s scal ed an d r o tated b y 90 deg r ees. ? b ? i n t h e fi gu re 8 s h ow s t h at h o ri z ont al si ze a n d ver tical size to be c o m p ared a r e e x cha n ged by 9 0 d e gree ro tatio n . ?c ? in th e fig u re 8 sho w s proh ib ited processin g . it is pro h i b ited setting th e scaling an d ro tatio n p a ram e ters to fu lfill all co nd itio n s as fo llows: x 90 or 2 70 de gre e rotation pro c e s sing i s perfo rme d. x the wi dth of input imag e is sho r ter than the height of output imag e. x the hei ght of input imag e is long er tha n the width of o u tput image.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 35 of 105 apr 18, 2013 in th is d r iv er, i n itial p h a se con tro l for ip con v e rsion is p e rfor m e d in th e scalin g and ro tatio n pro cess. fo r th is p r o cessi n g , th ere is no th ing th at u s ers h a v e to do . reg i sters and p a rame ters set in th e in itial p h a se con t ro l pro c essing are as b e low (see tabl e 11 ). table 11 initial scaling phase se tting s for ip con v ersion rotation horizontal scaling vertic al scaling register value normal scale up or down scale up or down res_top_inipase 2048 horizontal mirroring scale up or down scale up or down res_top_inipase 2048 scale down scale down res_top_inipase 2048 scale up and down - res_top_inipase 2048 90 degree rotation scale up scale up res_us_hb_iniphase 2048 scale up or down scale down res_top_inipase 2048 180 degree rotation scale up or down scale up res_btm_inipase 2048 scale down scale down res_top_inipase 2048 scale up and down - res_top_inipase 2048 270 degree rotation scale up or down scale up res_us_ht_iniphase 2048 me m b ers of t h e struct ure vd c4_resframebuff ar e show n b e l o w. typedef struct { _sint res_bst_md ; void *res_base ; _uword res_ln_off ; _udword res_flm_off ; vdc4_resformat res_md ; vdc4_onoff res_dth_on ; vdc4_resfsrate res_fs_rate ; _sint res_fld_sel ; _sint res_inter ; _uword res_flm_num ; _sint res_loop ; _udword bg_color ; } vdc4_resframebuff ; ty pe member name input/ outpu t des c ription _sint re s_b s t_md in tran sfe r burst length fo r frame b u ffer writing a n d rea ding ? 0: 32-byte tra n sfe r ? 1: 128-byte transfe r void * re s_b a s e in fram e buffer base add re ss null mu st n o t be spe c ifie d. when res _ bst_md is set to 0: set addre s s on 32 -byte ali gnme n t. when res _ bst_md is set to 1: set addre s s on 128 -byte a lignme n t. _u wo rd res _ ln_off in fram e buffer line offset ad dre s s [byte] when res _ bst_md is set to 0: a multiple of 32 when res _ bst_md is set to 1:
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 36 of 105 apr 18, 2013 a multiple of 128 _u dw or d res _ flm_off in fram e buffer frame offset a ddress [byte] when res _ bst_md is set to 0: a multiple of 32 when res_bst_md is set to 1: a multiple of 128 vd c 4 _r es fo rma t re s_md in video-sig nal writin g format ? vdc4_ r es_ md_y cc422 : ycbcr422 ? vdc4_ r es_ md_ r gb5 6 5 : rgb565 ? vdc4_res_md_rgb888: rgb888 vdc 4 _onoff re s_dth _on in dithe r co rrect i on on/o ff ? vdc4_of f ? vdc4_on vd c 4 _r es fsr a te re s_fs_rate in writin g rate ? vdc4_res_fs_rate_p e r1: 1/1 ? vdc4_res_fs_rate_p e r2: 1/2 ? vdc4_res_fs_rate_p e r4: 1/4 ? vdc4_res_fs_rate_per8: 1/8 _sint re s_f l d_ sel in write field s e lec t ? 0: top field ? 1: bottom fiel d this parameter is valid when res_fs_rate is not set to vdc4_res_fs_rate_per1. _sint re s_inte r in field op eratin g mode sele ct ? 0: progressiv e ? 1: interlace _u wo rd re s_flm_n um in num ber of frame s of buffer (d efined b y res_flm_ nu m + 1) whe n type of video su rface (type) is set to: re cording 0x0000 ~ 0x0 3ff displ a y 0 or 1 (o ne o r two plane s) for rotated i m age setting res_flm_num to 0 is prohibited. _sint re s_lo op in fram e buffer write mo de select ? 0: frame mo de ? 1: line mode (read as ring buffer) _u dw or d bg_ colo r in backgroun d color setting whe n re s_m d is set to ycb c r422, sp ecify value i n cry c b format. except as n o ted ab ove, spe c ify value in rgb8 88 format. lsb-justified format. see figure 9 for the background color format.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 37 of 105 apr 18, 2013 background color r / cr (8bits) g / y (8bits) b / cb (8bits) 0x00 (8bits) ms b ls b figure 9 ba ckgrou nd color setting th e equ a tio n to co nv ert b e t w een r g b and ycbc r are as below (typical value for sta n dar d sm pte 2 93m ). y = 0.299 r + 0.587g + 0.1 14b cb = -0.16 9r ? 0.331g + 0 . 500b + 12 8.0 cr = 0.500 r ? 0.419g ? 0. 081b + 1 28.0 me m b ers of t h e struct ure vd c4_videodisplay ar e show n b e l o w. typedef struct { _uword res_vsdly ; vdc4_onoff gr_endian_on ; vdc4_yccswapformat gr_ycc_swap ; vdc4_yccexchgmode gr_cnv444_md ; } vdc4_videodisplay ; ty pe member name input/ outpu t des c ription _uwo rd r e s _ vsdly in vsync sign al delay co ntrol 0x0000 ~ 0x0 0ff delay[usec]: res_v s dly x output hsyn c pe riod[u s e c ] vdc4 _onoff gr_ endi an_ on in endian control of data rea d from buffer (o n/off) x vdc4_of f x vdc4_o n vdc4_yccswapfo r mat gr_y cc_swa p in cont rol s swappin g of d ata read fro m buffer in the ycb c r4 22 format x vdc4_yccs w ap_cby0cry 1: cby0cry1 x vdc4_yccs w ap_y0c by1cr: y0cby 1 cr x vdc4_yccs w ap_cry0 cby1: cry0cby1 x vdc4_yccs w ap_y0cry1cb: y0cry 1 cb x vdc4_yccs w ap_y1cry0cb: y1cry 0 cb x vdc4_yccs w ap_cry1 cby0: cry1cby0 x vdc4_yccs w ap_y1c by0cr: y1cby 0 cr x vdc4_yccs w ap_cby1cry 0: cby1cry0 this i s refe renced o n ly when video-signal writing format (res_ m d) is set to ycc42 2 . and this para m eter is valid o nly whe n en dian cont rol (gr_e ndian _on ) i s set to vdc4 _o n. vdc4_yccexchgmo de gr_ c nv4 44_m d in interpol ation mode fo r ycb c r4 22 to ycb c r444 conve r sion x vdc4_ycc_ 444_ ho ld: hold inte rp ol ation x vdc4_ycc_ 444_ave rage: average interp olation this i s refe renced o n ly when video-signal writing format (res_md) is s e t to ycbcr422.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 38 of 105 apr 18, 2013 2.3.5 vdc4_destro y s urface syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _d estroysrufa c e( vdc4_l aye r id id ) ; parameters ? [in]vdc4_lyerid id layer id retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus erro r co de no rmal en d. surface error. i llegal surface. surface error. illegal state. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the s u rface specified by id is destroyed. ? if t h e s u rface s p ecified by i d i s runnin g (the state of t h e s u rface is ?run?) , the s u rface is destroyed after s t op. ? the state of the surface speci fied b y id is tran sitio n e d t o ?init?.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 39 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 1: gra phics surfa c e 1 ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: gra phics surfa c e 3 ? vdc4_surface_video_1: video surface
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 40 of 105 apr 18, 2013 2.3.6 vdc4_regi stcallbackfunc syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _regist callb ackfun c( vdc4_i nttype type, void (*callba c k )( vd c4_intt y pe ), _uwo rd lin e_nu m ) ; parameters ? [in]vdc4_intt y pe type ? [in]void (*call back )( vdc4 _ i nttype ) ? [in]_uword line_num type of interrupt pointer to the c a llback function line inte rru pt set retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the s p ecifie d c allback function is registere d . the o n l y o n e o f cal l b ac k f u nc t i on ca n be reg i st ered fo r eac h i n t e rr upt t y p e . whe n t h e i n t e rr upt t y pe f o r whi c h t h e callb ack fun c tio n h a s alread y regi stered is specified , t h e re gistratio n o f th e callb ack fun c tio n is o v e rwritten . when th e callb ack fun c tio n po in ter ( ca llback ) is sett to ?0 ?, th e cal lb ack fu n c tion is un regi stered. nu m b er of lines d e term in in g th e ti m i n g to gen e rate an i n terru p t ( line_n um ) is v a lid o n ly wh en lin e sign a l fo r p a n e l o u t p u t is sp eci fied as i n terrup t typ e. the cal l b ac k f unct i o n i s exec ut ed i n t h e i n t e rr upt ha ndl e r a n d ret u rn s i n terrup t typ e t o th e arg u m en t. when in terru p t h a nd ler is no t d e fi n e d, th e callb ack fu n c tion reg i stered b y t h is fun c tio n is n o t ex ecu ted . fo r d e fin itio n of in terrup t handler, see 1 . 7 . an d fo r th e g e n e ration o f i n terrup t, it is necessary to en ab le th e i n terrupt in vdc 4 _ in it ialize. the registere d callback function is e x ecute d depe nding on s u rface states a n d interrupt types (see tabl e 12 ). the surfaces not s h own in table 12 m eans that the callback func tion is not exec uted (e.g. whe n gra phics s u rface 1 is create d , th e callb ack fun c tio n of vi_vsync in terru pt is no t ex ecu t ed .). table 12 surfac e sta t es and callba c k surfac e sta t es t y pe of interrupt surface init ready run vi_vsync video x o o lo_vsync all surfa c e x o o vsyncerr all surfa c e x o o vline all s u rfac e x x o vfield video x x o vbuferr1 video x x o vbuferr2 gra phi cs 1 x x o vbuferr3 gra phi cs 2 x x o vbuferr4 gra phi cs 3 x x o note: ?o? in the table mean s that the callb ack functio n is call ed. ?x? in the table mean s that the call ba ck fu nction i s not called.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 41 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_inttyp e type in type of interrupt ? vdc4_int_type_vi_vsy nc: vi_vsync ? vdc4_int _t ype_lo_vs y nc: lo _vsync ? vdc4_int_type_vsyncerr: vsyncerr ? vdc4_int_type_vline: vline ? vdc4_int_type_vfield: vfield ? vdc4_int_type_vbu ferr1: vbuferr1 ? vdc4_int_type_vbu ferr2: vbuferr2 ? vdc4_int_type_vbu ferr3: vbuferr3 ? vdc4_int_type_vbu ferr4: vbuferr4 void (*callba c k )( v dc4 _inttype ) in pointer to the c a llback function if it is unne ce ssary, 0 sh ou ld be set. syntax void callbackfunc( vdc4_inttyp e cb_type ) ; parameters ? [in]vdc4_intt y pe cb_type type of interrupt retu rn values ? void de scriptio n this callback function is called when the specified type of interrupt (type) is generated. and this function returns type of interrupt to the argument. _u wo rd line_n um in line nu mbe r timing to gen e r ate vline in terru pt sign al this p a ra met e r is valid o n l y when the type of interrup t (type) is vdc4_int_type_vline. th e vline in t e rru p t tim in g is sp eci fied b y l i n e _n u m in th e lin e nu m b er. th is lin e nu m b er is co un ted fro m vdc4 in tern al v e rtical syn c sign al (see fi g u re 1 0 ) . the t i m i ng rel a t i ons hi p bet w een vdc 4 i n t e rnal vsy n c an d lc d vsy n c i s defi ned by t h e set t i ng of lc d tc o n si gnal s t o dri v e t h e l c d panel . a n d t h e t i m i ng rel a t i ons hi p bet w e e n vdc 4 in tern al vsyn c an d th e v a lid period o f t h e fu l l screen to b e disp layed is d e fi n e d b y t h e settin g of fu ll-screen en ab le co n t ro l. fo r m o re in form at io n ab ou t th ese settin g s , see 2.3 . 1 vdc4_ i n itialize an d 4. 3 s e t t i ng e x am pl e f o r lc d.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 42 of 105 apr 18, 2013 vsync (lcd) vsync (vdc4) line_num res_f_vs res_f_vw vline interrupt full-image area vp vsync (vdc4): vdc4 internal vertical sync signal vsync (lcd): lcd vertical sync signal res_f_vs: vertical enable signal start position for full screen res_f_vw: vertical enable signal width for full screen vp: vertical period line_num: line number timing to generate vline interrupt signal figure 10 vline interru pt timing
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 43 of 105 apr 18, 2013 2.3.7 vdc4_grap h icsstartsu rface syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _g rap h icssta rts u rfa c e( vd c4_ layeri d id, con s t vdc4 _s howgraphi cs *gra phi cs ) ; parameters ? [in]vdc4_lye r id id ? [in]con s t vdc4 _sho wgraphi cs * graphics layer id gra phi cs di sp lay settings retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the display of the gra phics surf ace specifie d by id is started. ? the s p ecifie d param e ters fo r gra p hics are se t. ? the state of the graphics surface specifie d by id is tra n sitioned from ?ready? t o ?r un?. before th e settin gs are reflected , it will tak e a p e riod o f tim e equ a l to 1 vsy n c p e ri o d ti m e at th e m o st.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 44 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 1: gra phics surfa c e 1 ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: graphics surface 3 vdc4_s ho wg rap hics * gra phi cs in gra phi cs di sp lay settings null shoul d not be sp ecifi ed. me m b ers of t h e struct ure vd c4_showgraphics ar e show n b e l o w. typedef struct { vdc4_ctrlframebuff *ctrlframebuff ; vdc4_ctrldispsel *ctrldispsel ; vdc4_arearect *gr_arearect ; } vdc4_showgraphics ; ty pe member name input/ outpu t des c ription vdc4 _ctrlframebuff * ctrlf r ameb uff in gra phi cs fra m e buffer con t rol settings will b e left uncha n ged if null i s sp ecifie d. vdc 4 _c tr ld isp s e l * ctrl dis psel in gra phi cs di sp lay sele ct ion settings will b e left uncha n ged if null i s sp ecifie d. vdc 4 _ a r e ar ec t * g r _ a r e ar ec t in display area settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. gr_a rea re c t -> h s sh ould be 1 6 cl o ck cy cl es o r g r ea te r . gr _ar e ar ec t-> h s + gr _ a re are c t-> h w s h ou ld be 2015 cl ock cycle s or le ss. gr_a rea r ect->hw sho u l d be 3 clo c k cy cle s or g r eate r . gr_a rea r e c t - >v s sho uld be 4 lines or greate r . gr_a rea r e c t - >v s + gr_a rearect - >v w sho u ld b e 20 39 lines or less. memb ers of t h e struct ure vd c4_ctrlframebuff are s h own below. typedef struct { _sint chgframenum ; void *buffer ; } vdc4_ctrlframebuff ; ty p e member name input/ outpu t des c ription _sint chgf ra me nu m in fram e numb er of frame b uffer 0 or 1 only valid wh en dou ble buf fering i s ena b l ed. fram e num b er is 0 initiali zed wh en g r aphi cs su rface is create d . void * buffer in fram e buffer base add re ss ignored in thi s drive r call.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 45 of 105 apr 18, 2013 me m b ers of t h e struct ure vd c4_ctrldispsel ar e show n b e l o w. typedef struct { vdc4_dispsel gr_disp_sel ; } vdc4_ctrldispsel ; ty pe member name input/ outpu t des c ription vdc4_ d i s psel gr_ disp_ sel in gra phi cs di sp lay mode ? vdc4_dispsel_bac k: back ground ? vdc4_dispsel_lower: lower-layer graphi cs ? vdc4_dispsel_curre nt : current graphics ? vdc4_dispsel_blend : blende d cu rrent gra phi cs with lower-lay er graphi cs this setting is prohi bited for the grap hics 1 pro c e s s. before startin g display, graphi cs displa y mode is as belo w (see table 13 ). the gra p hics display m ode is transitione d de pe nding on the state of the surfaces as bel o w. table 13 gr aphics dis pla y mode and surface state surfac e init ready run video background background lower-layer graphics graphics 1 background background user-specified value graphics 2 lower-layer grap hics lower-layer graphics user-specified value graphics 3 lower-layer grap hics lower-layer graphics user-specified value fo r t h e enl a r g e d gra p hi cs di s p l a y i n t h e gra p hi cs 1 pr ocess, t h e g r a phi cs di spl a y m ode sh oul d be set t o ? l o w er -l ay er gra p hi cs? by us er.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 46 of 105 apr 18, 2013 2.3.8 vdc4_vide o startsurfa ce syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _videostartsu rface ( vdc4_l a y erid id ) ; parameters ? [in]vdc4_lyerid id layer id retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus erro r co de no rmal en d. surface error. i llegal surface. surface error. illegal state. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the vide o s u rface specifie d by id is starte d. ? the state of the vide o surface sp ecified b y id is transitio n e d fro m ?read y? t o ?run ?. before th e settin gs are reflected , it will tak e a p e riod o f tim e equ a l to 1 vsy n c p e ri o d ti m e at th e m o st.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 47 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_video_1: video surface
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 48 of 105 apr 18, 2013 2.3.9 vdc4_grap hicschangeparam syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _g rap h icsch a n geparam( vd c4_ laye r id i d , con s t vdc4 _s howgraphi cs *gra phi cs ) ; parameters ? [in]vdc4_lye r id id ? [in]con s t vdc4 _sho wgraphi cs * graphics layer id gra phi cs di sp lay settings retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the fram e buff er is e x cha n ge d fo r s p ecified bu ffe r. ? the gra p hi cs d i spl a y m ode i s chan ge d. ? the display a r ea is cha n ged. before th e settin gs are reflected , it will tak e a p e riod o f tim e equ a l to 1 vsy n c p e ri o d ti m e at th e m o st.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 49 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 1: gra phics surfa c e 1 ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: graphics surface 3 vdc4_s ho wg rap hics * gra phi cs in gra phi cs di sp lay settings null shoul d not be sp ecifi ed. me m b ers of t h e struct ure vd c4_showgraphics ar e show n b e l o w. typedef struct { vdc4_ctrlframebuff *ctrlframebuff ; vdc4_ctrldispsel *ctrldispsel ; vdc4_arearect *gr_arearect ; } vdc4_showgraphics ; ty pe member name input/ outpu t des c ription vdc4 _ctrlframebuff * ctrlf r ameb uff in gra phi cs fra m e buffer con t rol settings will b e left uncha n ged if null i s sp ecifie d. vdc 4 _c tr ld isp s e l * ctrl dis psel in gra phi cs di sp lay sele ct ion settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.3.7 for the stru cture vd c4_ c trl d ispsel. vdc 4 _ a r e ar ec t * g r _ a r e ar ec t in display area settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. gr_a rea re c t -> h s sh ould be 1 6 cl o ck cy cl es o r g r ea te r . gr _ar e ar ec t-> h s + gr _ a re are c t-> h w s h ou ld be 2015 cl ock cycle s or le ss. gr_a rea r ect->hw sho u ld be 3 clo c k cy cle s or g r eate r . gr_a rea r e c t - >v s sho uld be 4 lines or greate r . gr_a rea r e c t - >v s + gr_a rearect - >v w sho u ld b e 20 39 lines or less. memb ers of t h e struct ure vd c4_ctrlframebuff are s h own below. typedef struct { _sint chgframenum ; void *buffer ; } vdc4_ctrlframebuff ; ty p e member name input/ outpu t des c ription _sint chgf ra me nu m in fram e numb er of frame b uffer 0 or 1 only valid wh en dou ble buf fering i s ena b l ed. void * buffer in fram e buffer base add re ss only valid wh en sin g le buff e rin g is en abl ed.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 50 of 105 apr 18, 2013 2.3.10 vdc4_vide o changeparam syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _video cha ngep aram ( vdc4_l ayerid id, con s t vdc4 _chang evide o *chgvi deo ) ; parameters ? [in]vdc4_lye r id id ? [in]con s t vdc4 _ch ang evide o * chgvideo layer id cha nge vide o setting retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? im age area to be ca ptured is change d. ? im age out put e n able signal is change d. ? scal i ng a n d rot a t i on param e t e rs a r e c h an ge d. whe n scal i n g and/ or r o t a t i o n pa ram e t e rs are cha nge d, n o t e fra m e bu ffe r o v er flo w . if en o u g h m e m o ry is n o t allocated t o th e v i d e o su rface, th e settin g p a ram e ters in t h is fun c tio n m i ght ca use inc o rrect buffer acc ess. f o r in fo rm ation a b o u t fram e buffe r of vi de o i m age, s ee 2. 3. 4. before th e settin gs are reflected , it will tak e a p e riod o f tim e equ a l to 1 vsy n c p e ri o d ti m e at th e m o st.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 51 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_video_1: video surface vdc4_ c h ang evideo * chgvi deo in cha nge vide o setting null shoul d not be sp ecifi ed. me m b ers of t h e struct ure vd c4_changevideo ar e show n b e l o w. typedef struct { vdc4_arearect *res ; vdc4_arearect *res_p ; vdc4_scalingrot *scalerot ; } vdc4_changevideo ; ty pe member name input/ outpu t des c ription vdc 4 _ a r e ar ec t * re s in image area to be ca ptured settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. re s->h s sho ul d be 16 clock cycles or gre ater. res->hs + res->hw sh ould b e 20 15 clo ck cycl es or less. and res- >h w sh ould b e 4 clo ck cycl es alig nme nt. re s->vs shoul d be 4 line s or greate r . re s->vs + re s- >vw shoul d be 2039 line s or less. and re s->vw shou ld be 4 line s alig nment. vdc 4 _ a r e ar ec t * re s_p in image outp u t enabl e sig nal settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. re s_p - >hs should be 16 clock cycle s or gre ater. re s_p -> h s + r e s_ p- >h w s h ould b e 201 5 clo ck cy cle s or less. and res_ p->h w should b e 4 clock cy cl es alignm ent. re s_p - >v s sh ould be 4 lines or greate r . res_p - >v s + re s_p - >v w sh ould be 20 39 lines o r less. and res_p - >v w sho u ld be 4 li nes ali gnm en t. vdc4_scali ng rot * scale r ot in scalin g and rotation pa ram eter settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.3.4 for the stru cture vd c4_ s calin grot.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 52 of 105 apr 18, 2013 2.3.11 vdc4_stop s urface syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _stopsur fa ce ( vdc4 _laye r id id ) ; parameters ? [in]vdc4_lyerid id layer id retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus erro r co de no rmal en d. surface error. i llegal surface. surface error. illegal state. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the s u rface specified by id is stoppe d. ? the gra p hi cs d i spl a y m ode i s chan ge d. ? the state of the surface speci fied by id is tran sitio n e d fro m ?run ? to ?ready?. whe n vide o surface is stoppe d, write and re ad access to t h e fra m e buffe r is disable d . when gra phics s u rface is st opped, read access t o t h e fram e buffe r is disable d . for inform ation ab out the cha n ge of the gra phics display m ode in the stop process , see ta ble 13.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 53 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 1: gra phics surfa c e 1 ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: gra phics surfa c e 3 ? vdc4_surface_video_1: video surface
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 54 of 105 apr 18, 2013 2.3.12 vdc4_imag e colormatri x syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _image col o rm atrix( co nst vdc4 _colo r ma trix *mtx ) ; parameters ? [in]const vdc4_colormatrix *mtx color matrix parameter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_others erro r co de no rmal en d. surface error. illegal state. parameter error. out of range. parameter error. others. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? sp ecified co lo r m a trix is set. two co lo r m a t r ices are av ailab l e. on e is in th e inpu t cont roller and th e o t her is in th e im a g e q u a lity i m p r o v e r (see figu re 1 1 ). input controller input controller scaler scaler graphics 1 graphics 1 image synthesizer image synthesizer image quality improver image quality improver color matrix color matrix color matrix color matrix frame buffer frame buffer vdc4_colormtx_imgcnt vdc4_colormtx_imgcnt vdc4_colormtx_adj vdc4_colormtx_adj graphics 2 graphics 2 input input graphics 3 graphics 3 figure 11 color matrix as s h ow n i n fig u re 11 , co lor matrix vdc4_colormtx_imgcnt acts on in pu t v id e o si g n a l and co lor matrix vdc4_colormtx_adj act s o n i n p u t vi deo si g n al an d gra phi cs 1 o u t p ut si gnal . whe n vide o surface or gra phi cs 1 surface is use d , it is not n ecessary to set color m a trix va lue. t h e c o lor matrices are in itialized wh en v i d e o su rface and g r aph i cs 1 surface are crea ted . for informatio n abo u t co lor m a trix in itializat io n , see tabl e 14 an d table 15.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 55 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ c ol orm a trix * mtx in colo r matrix paramete r null should not be specified. me m b ers of t h e struct ure vd c4_colormatrix ar e show n b e l o w. typedef struct { vdc4_colormtxmodule module ; vdc4_colormtxmode mode ; _uword dcoffset[ vdc4_colormtx_ofs_num ] ; _uword matrix[ vdc4_colormtx_gain_num ] ; } vdc4_colormatrix ; ty pe member name input/ outpu t des c ription vdc4_c ol orm t xmodule modul e in targ et modul e of a colo r matrix (se e f i gu r e 11 ) ? vdc4_colormtx_imgcnt: input cont roll er output from n o ise red u ctio n ? vdc4_colormtx_a d j : image qu ality improve r output from scale r (g ra phi cs 1) vdc4_c ol orm t xmode mode in colo r matrix ope rating mo de ? vdc4_ c ol o r mtx_ gbr_ gbr: gbr => gbr ? vdc4_colormtx_gbr_ycbcr: gbr => ycb c r ? vdc4_colormtx_y c b c r_gb r: ycbcr => gbr ? vdc4_colormtx_y c b c r_ycb cr: ycbcr => ycbcr whe n modul e is set to vdc4_colormtx_a d j , vdc4_ c ol o r mtx_ gbr_ ycbcr and vdc4_ c ol o r mtx_y c b c r_ycb c r should not be sp ecifie d. _uwo rd dcoffs et[ vdc4_col ormtx_ofs_num ] in offset adju s tment of y/g, b and r si gn al un sign ed (0 (-12 8) ~ 0x0 0 ff (+127 )) _uwo rd matrix[ vdc4_color mtx_gain_num ] in gain adjus tment of gg, gb, gr, bg, b b , br, rg, rb and rr signed (two? s compl eme nt) (-1 024 ~ +1 023, 25 6 = 1.0 [times]) tabl e 1 4 shows wh ich co l o r matrix op erating m o d e in two co lor m atrices sho u l d b e in itialized to , wh en v i d e o surface o r gra p hics s u rfac e is created. c o lor m a trix operating m ode de pen d s o n t h e s i gnal fo rm at of vi de o su rface and g r a phi cs 1 surface. wh en t h e co lor m a trix o p e rat i n g m o d e is specified , t h e co lo r m a trix v a lu e shou ld b e set t o as shown in tabl e 15 . t h e co nv er sion b e tw een y c b cr an d rg b fo llow s smpte 293 m.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 56 of 105 apr 18, 2013 table 14 color matrix operating mode initial setting su rface input select external input sy s t em format select f r ame bu ffer vide o-sig n a l writing format f r ame bu ffer signal readin g format vdc4_color- mtx_imgcnt vdc4_color- mtx_ a d j ycbcr (ycbcr4 22) -* ycbcr to ycbcr ycbcr to rgb vide o deco der output sig nal - rgb (rgb565, rgb888) -* ycbcr to rgb rgb to rgb ycbcr (ycbcr4 22) -* ycbcr to ycbcr ycbcr to rgb ycbcr (bt 656, bt 601) rgb (rgb565, rgb888) -* ycbcr to rgb rgb to rgb ycbcr (ycbcr4 22) -* rgb to ycbcr ycbcr to rgb vide o sign al sup p li ed via the e x tern al input p i ns rgb (rgb888, rgb666, rgb565) rgb (rgb565, rgb888) -* rgb to rgb rgb to rgb ycbcr (ycbcr4 22) - ycbcr to rgb graphics 1 - - - rgb (rgb565, rgb888, argb155 5, argb444 4, argb888 8, clut 8, clut 4, clut 1) - rgb to rgb note: * the frame b u ffer sig nal writing an d rea d ing form at of the video su rface a r e the same form at. table 15 co lor matrix co efficie nt (initial value) color ma trix parameters gbr to gbr gbr to ycbcr ycbcr to gb r ycbcr to ycbcr offset adjustment of y/g signal 128 128 128 128 offset adjustment of b signal 128 128 128 128 offset adjustment of r signal 128 128 128 128 y/g signal gain adjustment for y/g signal output 256 150 256 256 cb/b signal gain adjustment for y/g signal output 0 29 1960 0 cr/r signal gain adjustment for y/g signal output 0 77 1865 0 y/g signal gain adjustment for cb/b signal output 0 1963 256 0 cb/b signal gain adjustment for cb/b signal output 256 128 454 256 cr/r signal gain adjustment for cb/b signal output 0 2005 0 0 y/g signal gain adjustment for cr/r signal output 0 1941 256 0 cb/b signal gain adjustment for cr/r signal output 0 2027 0 0 cr/r signal gain adjustment for cr/r signal output 256 128 359 256
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 57 of 105 apr 18, 2013 2.3.13 vdc4_vide o noisered uction syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _video noi s e r ed uction ( vdc4_ o noff nr1 d_o n, con s t v d c4 _n oise re du ct io n *nr ) ; parameters ? [in]vdc4_o no ff nr1d_o n ? [in]const vdc4_noisereduction *nr noi s e redu cti on on/o ff control noi s e redu cti on pa ramete r retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? horizontal noi se re ductio n pa ram e t e rs are se t . th e op erating m o d e in horizon tal no ise reductio n (i.e., r/g/b m o d e an d y/cb /cr m o d e ) i s set au t o m a t i c a lly d e p e nd ing o n th e i n pu t si g n als sp eci fied in vdc 4_vi deocreatesurfa ce. if t h is fun c tio n is no t called , th e h o rizon t al no ise redu c tio n p a ram e ters will b e left un ch an g e d since a reset. fo r in fo rm atio n abo u t i n itial v a lue after a reset, see "sh 726 8 grou p, sh7 269 grou p user?s manu al: hard ware ( r01 uh0 048 ej) " .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 58 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc 4 _onoff nr1 d_o n in noi s e redu cti on on/o ff control ? vdc4_of f ? vdc4_on vdc4_ n oi se redu ction * nr in noi s e redu cti on pa ramete r settings will b e left uncha n ged if null i s sp ecifie d. me m b ers of t h e struct ure vd c4_noisereduction are sh ow n bel o w. typedef struct { vdc4_nrparam y ; vdc4_nrparam cb ; vdc4_nrparam cr ; } vdc4_noisereduction ; ty pe member name input/ outpu t des c ription vdc4 _nr p ar am y in noi s e redu ct ion pa ramete r of y/g signa l vdc4 _nr p ar am cb in noi s e redu ct ion pa ramete r of cb/b sign al vdc4 _nr p ar am cr in noi s e redu ct ion pa ramete r of cr/r sign al memb ers of t h e struct ure vd c4_nrparam are s h ow n bel o w . typedef struct { vdc4_nrtap nr1d_tap ; _uword nr1d_th ; vdc4_nrgain nr1d_gain ; } vdc4_nrparam ; ty p e member name input/ outpu t des c ription vdc4 _nr t ap nr1 d_tap in tap select ? vdc4_nr_t apsel_1: adjacent pixel ? vdc4_nr_t apsel_2: 2 adjacent pixel s ? vdc4_nr_t apsel_3: 3 adjacent pixel s ? vdc4_nr_t apsel_4: 4 adjacent pixel s _uword nr1 d_th in maximum val ue of sign al corin g (ab s ol ute value) 0 ~ 0x007 f vdc4_nrgai n nr1 d_g ain in noi s e redu ct ion gain a dju stment ? vdc4_ n r_g a in_1_ 2: 1/2 ? vdc4_ n r_g a in_1_ 4: 1/4 ? vdc4_ n r_g a in_1_ 8: 1/8 ? vdc4_ n r_g a in_1_ 16: 1/16
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 59 of 105 apr 18, 2013 2.3.14 vdc4_imag eenhancement syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _imageen han cement( vd c4_ o noff bkstr_ on, c o ns t vdc 4 _b lack *black , vdc4_ o noff shp_h _on, con s t vdc4 _e nhan ces harp *sha rp, vdc4_ o noff lti_h_o n, con s t vdc4 _e nhan ce lti *lti, con s t vdc4 _a rea r e c t *enh area ) ; parameters ? [in]vdc4_o no ff bkstr_ on ? [in]c o ns t vdc 4 _black *black ? [in]vdc4_o no ff shp_h_ on ? [in]con s t vdc4 _enha ncesh a rp * s ha rp ? [in]vdc4_o no ff lti_h_on ? [in]con s t vdc4 _enha ncelti *lti ? [in]const vdc4_arearect *enharea black stret c h on/off cont rol black stret c h paramete r sharp n e ss o n /off contro l sh a r pn es s pa r a me te r lti on/off cont rol lti para m ete r enhan cem en t area of a re ctangl e retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid vdc4_err_param_others erro r co de no rmal en d. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. param e ter e r ror. othe r s . descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? black stretch is tu rn ed o n / o f f. ? black stretch param eters are s et. ? sh arpn ess is turn ed on /o ff. ? sha r pness pa ra meters are set. ? lti (l um i n ance tra n si ent i m provem e nt ) i s t u r n e d on/ of f. ? lti param e ters are set. ? en hance r a r ea i s set. in this function, each pa ram eter a n d turn ing on/ off c ont rol can be set i ndi vidually . if null pointe r to s et param eters is sp ecified, p arameters for im a g e q u ality i m p r o v e r will be left u n c h a n g e d . if th is functio n is no t called , the p a ram eters will b e left un ch ang e d si n ce a reset. for informatio n ab o u t i n itial v alu e after a reset, see "sh7 268 grou p, sh726 9 gr o u p use r ? s m a nual : har d ware (r 01 u h 0 0 4 8 ej )". whe n usi n g sha r pne ss o r l t i, t h e e nha nce r area s h o u l d be set at least once . if t h is fun c tio n is called in case of rgb signal in pu t, th e p a ram eter error (vdc 4_ err_ param _ others) will b e retur n e d .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 60 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc 4 _onoff bkstr_ on in black stret c h on/off cont rol ? vdc4_of f ? vdc4_on vdc 4_black * black in black stret c h paramete r settings will b e left uncha n ged if null i s sp ecifie d. vdc 4 _onoff shp _h_ on in sharp n e ss o n /off contro l ? vdc4_of f ? vdc4_o n vdc4_e nha ncesharp * sha r p in sh a r pn es s pa r a me te r settings will b e left uncha n ged if null i s sp ecifie d. vdc 4 _onoff lti_h_on in lti on/off cont rol ? vdc4_of f ? vdc4_o n vdc4_e nha ncelti * lti in lti para m ete r settings will b e left uncha n ged if null i s sp ecifie d. vd c 4 _ a r e ar ec t * enhare a in enhan cem en t area of a re ctangl e settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. enhare a->h s shoul d be 4 cl o ck cycle s or greate r . enhare a->vs sho u ld be 2 li nes o r greate r . me m b ers of t h e struct ure vd c4_black are show n b e l o w. typedef struct { _uword bkstr_st ; _uword bkstr_t1 ; _uword bkstr_t2 ; _uword bkstr_d ; } vdc4_black ; ty pe member name input/ outpu t des c ription _uwo rd bk st r_ st in black stret c h start poi nt 0 ( l ow ) ~ 15 (h ig h) _uwo rd bkstr_t1 in black stret c h time con s tant (t1) 0 (sm a ll) ~ 31 (larg e ) _uwo rd bkstr_t2 in black stret c h time con s tant (t2) 0 (sm a ll) ~ 30 (larg e ) _uwo rd bkstr_ d in black stret c h depth 0 (shallo w) ~ 15 (d eep )
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 61 of 105 apr 18, 2013 me m b ers of t h e struct ure vd c4_enhancesharp ar e show n b e l o w. typedef struct { _sint shp_h2_lpf_sel ; vdc4_sharpnessctrl hrzsharp[ vdc4_imgenh_sharp_num ] ; } vdc4_enhancesharp ; ty pe member name input/ outpu t des c ription _sint shp _h2 _lpf_ s el in lpf sele ctio n for folding prevention before h2 edge d etectio n ? 0: lpf not se lected ? 1: lpf sele cted vdc4_s harpn essct r l hrz s harp[ vdc4_imge n h_s h arp_num ] in ho rizontal sh arp ne ss (h1, h2, h3 ) hrz s harp[ vdc4_imge n h_s h arp_h1 ]: h1 hrz s harp[ vdc4_imge n h_s h arp_h2 ]: h2 hrz s harp[ vdc4_imge n h_s h arp_h3 ]: h3 me m b ers of t h e struct ure vd c4_sharpnessctrl are s h own below. typedef struct { _uword shp_clip_o ; _uword shp_clip_u ; _uword shp_gain_o ; _uword shp_gain_u ; _uword shp_core ; } vdc4_sharpnessctrl ; ty pe member name input/ outpu t des c ription _uwo rd shp _cli p_o in sharp ne ss correctio n val ue cli ppin g (on the ove r shoot side ) 0x0000 ~ 0x0 0ff _uwo rd shp _cli p_u in sharp ne ss correctio n valu e clip ping (on the und ersh oot side ) 0x0000 ~ 0x0 0ff _uwo rd shp _gai n_o in sharp ne ss edge am plitude value gain (on the oversho o t sid e ) 0x0000 (0 ti mes) ~ 0x0 040 (1 time s) ~ 0x00f f (ap prox . 4tim es ) _uwo rd shp _gai n_u in sharp ne ss edge am plitude value gain (on the unde rsho ot si de) 0x0000 (0 ti mes) ~ 0x0 040 (1 time s) ~ 0x00f f (ap prox . 4tim es ) _uwo rd shp _ c o r e in active sha r pn ess ra nge 0x0000 ~ 0x0 07f mem b ers of t h e struct ure vd c4_enhancelti are s h own below. typedef struct { _uword lti_h2_inc_zero ; _sint lti_h2_lpf_sel ; _uword lti_h2_gain ; _uword lti_h2_core ; _uword lti_h4_inc_zero ;
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 62 of 105 apr 18, 2013 _sint lti_h4_median_tap_sel ; _uword lti_h4_gain ; _uword lti_h4_core ; } vdc4_enhancelti ; ty pe member name input/ outpu t des c ription _u wo rd lti_h2_in c _ z e r o in media n filter lti corre c tion threshold (h2) 0x0000 ~ 0x0 0ff _sint lti_h2_lpf_ s el in lpf sel e ctio n for foldin g preventio n before h2 e dge detectio n ? 0: lpf not se lected ? 1: lpf sele cted _u wo rd lti_h2_g ain in lti edge am plitude value gain (h2 ) 0x0000 (0 ti mes) ~ 0x0 040 (1 time s) ~ 0x00f f (ap prox . 4tim es ) _u wo rd lti_h2_ co re in lti cori ng (m aximum co re value of 255 ) (h2) 0x0000 ~ 0x0 0ff _u wo rd lti_h4_in c _ z e r o in media n filter lti corre c tion threshold (h4) 0x0000 ~ 0x0 0ff _sint lti_h4_m edia n_tap_ sel in media n filter refere nce pixe l sele ct ? 0: secon d adj ace n t pixel se lected a s refe ren c e ? 1: adjace nt pixel sele cted a s refe ren c e _u wo rd lti_h4_g ain in lti edge am plitude value gain (h4 ) 0x0000 (0 ti mes) ~ 0x0 040 (1 time s) ~ 0x00f f (ap prox . 4tim es ) _u wo rd lti_h4_ co re in lti cori ng (m aximum co re value of 255 ) (h4) 0x0000 ~ 0x0 0ff
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 63 of 105 apr 18, 2013 2.3.15 vdc4_grap hicsalphablending syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _g rap h icsa lph a b lendin g ( vdc4_laye r id id, vdc4_ o noff gr_ a rc_o n, con s t vdc4 _a lphaattr *attr ) ; parameters ? [in]vdc4_lye r id id ? [in]vdc4_o no ff gr_arc_o n ? [in]const vdc4_alphaattr *attr layer id alpha ble ndin g in a re ctang ular a r ea o n / off alpha ble ndin g attribute pa ramete r retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? param e ters fo r alpha blen din g in a rectangular area are set. ? rectangular a r ea for al pha bl endi ng is set. rectan gu lar area fo r al p h a b l en d i n g is in itialized to th e same area th at is sp ecified as d i sp lay area wh en graph i cs su rface is created. whe n al pha bl endi ng wi t h o u t fa de-i n/ out i n rect an gul ar are a has al ready t u r n e d on , al p h a val u e can n o t be c h a nge d. t o change al pha value, it is necessary to t u rn off alpha ble ndi ng at least once . befo re t h e settings are reflect ed, it will take a peri od o f t i m e equal t o 1 vsy n c peri od t i m e at t h e m o st .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 64 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: graphics surface 3 vdc 4 _onoff gr_ arc_o n in alpha ble ndin g in a re ctang ular a r ea o n / off ? vdc4_of f ? vdc4_o n vdc4_al phaa ttr * attr in alpha ble ndin g in a re ctang ular a r ea attri bute pa ramet er settings will b e left uncha n ged if null i s sp ecifie d. me m b ers of t h e struct ure vd c4_alphaattr are s h ow n bel o w. typedef struct { vdc4_arearect *gr_arc ; vdc4_alphafade *fade ; } vdc4_alphaattr ; ty pe member name input/ outpu t des c ription vdc 4 _ a r e ar ec t * gr_ arc in re ctang ula r are a paramet er for alp ha bl endin g settings will b e left uncha n ged if null i s sp ecifie d. see se ction 2.1.3 for the stru cture vd c4_ a rea r e c t. vdc4_alphaf ade * fade in alpha ble ndin g/fading pa ra meter settings will b e left uncha n ged if null i s sp ecifie d. mem b ers of t h e struct ure vd c4_alphafade are s h ow n bel o w. typedef struct { _uword gr_arc_def ; _sword gr_arc_coef ; _uword gr_arc_rate ; } vdc4_alphafade ; ty p e member name input/ outpu t des c ription _uwo rd gr_ arc_d ef in initial alpha value for alp ha blendi ng in a rectan gu lar are a 0 ~ 255 _swo rd gr_ arc_ c oef in alpha coefficient for alpha blendin g in a rectang u l ar are a -25 5 ~ 25 5 _uwo rd gr_ arc_ r ate in fram e rate fo r alph a blen di ng in a re ctan gula r are a the num be r of vsync si gn al risi ng ed ge s. each time the vsync sign al rise s for the numbe r of times set in the gr_arc_ rate + 1, th e value of the gr_ a rc_ c oef i s add ed to the alpha valu e . 0 ~ 255
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 65 of 105 apr 18, 2013 2.3.16 vdc4_grap hicschromake y syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _g rap h icsc hro m akey( vdc4 _laye r id id, vd c 4 _o n o ff g r _ck _ on , c o ns t vdc 4 _chromakeyattr *attr ) ; parameters ? [in]vdc4_lye r id id ? [in]vdc4_o no ff gr_ck_o n ? [in]const vdc4_chromakeyattr *attr layer id ch roma -key pro c e s sing o n /off ch roma -key attribute pa ra meter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? chr o m a -key p a ram e ters are se t. chrom a -key processing c o ntains t w o col o rs: signals for c h rom a -key proce ssing an d re placed si gnals. in this drive r , t h e co lor v a lu e shou ld b e sp ecified in th e sam e c o lor form at th a t target s u rface contains, with th e ex cep tion of th e fo llo wi n g ite m s : ? when clut4 or clut 8 is used i n the target surf ace, replaced si gnals should be specified in ar gb8888 form at. ? whe n r g b565 or rgb 8 88 i s use d i n the target s u rface, re placed al pha si gnal should be specified se parately. ? w h en a r g b15 55 is u s ed i n t h e targ et su rf ace, alph a si g n a l is no t supp or t e d . in this dri v er, if alpha blending in a rectangular area is pe rform e d on t h e s a m e gra phics s u rface, al pha blending is perform ed in a specified recta n gular ar ea. in the ot her area, chro m a - k ey pro cessing is p e rf or m e d . an d ch ro m a - k ey p r o cessi n g is proh ib ited wh en the co lor format is sp ecified as clut1 .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 66 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: graphics surface 3 vdc 4 _onoff g r _ck _ on in cl ut-i ndex/ rgb-i ndex chrom a -key proce s sing o n / off ? vdc4_of f ? vdc4_o n vdc4_ c h r om akeyattr * attr in ch roma -key attribute pa ra meter settings will b e left uncha n ged if null i s sp ecifie d. me m b ers of t h e struct ure vd c4_chromakeyattr are s h own below. typedef struct { _udword ck_color ; _udword rep_color ; _udword rep_alpha ; } vdc4_chromakeyattr ; ty pe member name input/ outpu t des c ription _udw or d ck_colo r in rgb/clut si gnal for chro ma-key proce ssi ng specify value in the same co lor format (lsb-justified) that target su rface contai n s . for more informatio n ab out c o lor format, s ee figure 12 . _udw or d rep _ c o lor in repl aced argb sign al whe n the col or format that target surfa c e contain s is set to cl ut 4 or cl ut 8, spe c ify value in argb8 888 format. exce pt as n o ted above, spe c i f y value in the sam e col o r format (lsb-j u stified ) that target su rfa c e contai ns. fo r more info rm ation ab out color fo rmat, see figure 12. _udw or d rep _alp ha in repl aced alp ha sig nal specify repl ace d alpha sign al (8bit lsb-ju stified) whe n sign al format in targ et surfa c e is rgb56 5 or rgb8 88 whi c h do es n ot have alph a value. for m o re informatio n a bout col o r format, see figure 12.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 67 of 105 apr 18, 2013 chroma-key color ms b ls b r (5bits) g (6bits) b (5bits) 0 x 0 0 (16b i t s ) rgb565 0x00 (16bits) r (4bits) g (4bits) b (4bits) a (4b i t s) argb4444 r (8bits) g (8bits) b (8bits) a ( 8bit s ) argb8888, clut8, clut4 r (8bits) g (8bits) b (8bits) 0x 00 ( 8bit s ) r g b 8 8 8 argb1555 0x00 (16bits) r (5bits) g (5bits) b (5bits) a (1bit) clut (8bits) 0 x 0 0 (24b i t s ) clut8 clut (4bits) 0 x 0 0 (28b i t s ) clut4 a (8bits) 0 x 0 0 (24b i t s ) alpha(rgb565, rgb888) 1. 2. 3. 4. 5. 6. 7. 8. figure 12 chroma-key colors figu re 1 2 s h o w s c o lo r data f o rm at for ch ro m a -key . w h en th e co l o r fo r m at is rg b565 , rg b88 8 , a r g b155 5, argb 44 4 4 or argb 88 8 8 , c k_color and rep_color sh oul d be s p ec i f i e d as a b ove ( s ee f r om no .1 t o no .5 i n fig u re 12 ). in ad d ition , wh en th e co lor format is rgb565 o r rgb 8 88 t h at h a v e no al p h a v a lu e, alph a valu e of rep l aced si gnal s h oul d b e speci fi e d by rep_alpha as n o . 8 . i n case of c l ut 8 a n d c l ut 4, ck_c olor shou ld be sp ecif ied as no .6 an d 7, an d rep_color sh oul d be s p ec i fi e d i n ar gb 88 8 8 fo rm at as n o . 5 .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 68 of 105 apr 18, 2013 2.3.17 vdc4_grap h icssetclut syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _g rap h icss etcl ut( vd c4_ l a y erid id, co nst vdc4_clut *table ) ; parameters ? [in]vdc4_lye r id id ? [in]const vdc4_clut *table layer id pointer to clut parameter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc 4_er r _ s urfa c e_b a d vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_undef vdc4_err_param_others erro r co de no rmal en d. surface erro r. i llegal su rface. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. undefin e d . param e ter e r ror. othe r s . descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? clut data for the gra p hics s u rface s p ecifie d by id is set. ? whe n cl ut form at is used in the target surface, cl ut da ta is set. ? whe n ar gb1 5 5 5 is use d i n t h e tar g et s u rfa ce, alpha value is set. wh en u s i n g clut fo rm at o r ar gb15 55 form at, th is fun c tio n shou ld b e called at least on ce. after the graphics surface is destroyed by cal ling vdc 4_de stroysurface, clut data is not guara n teed. subseque ntly, whe n t h e sam e graphics s u rfa ce is created, c lut data sho u ld b e set ag ain b y th is clut fu n c tion call. whe n t h e gra p hics surface that has clut form at is stop pe d displaying, c l ut data is left unc ha nge d by calling vdc 4_stopsurface. after t h a t , the sam e gra phi cs surface is displayed a g a i n by calling vdc4_gra phics startsurface (withou t callin g th is clut fun c tion), th e sa me color can be dis p layed as before . before th e clut d ata setting s are reflected, it will tak e a p eri o d of tim e eq u al t o 1 vsy n c p eri o d ti m e at th e m o st. note t h e c l u t dat a set t i ngs w h en lc d i s di spl a y e d. if t h e f unct i on sh o w n bel o w i s cal l e d , wa i t 1 v s y n c peri od t i m e bef o re c l ut dat a set t i ngs. ? vdc 4_graphi csstartsurface ? vdc 4_stopsurface ? vdc 4_graphi cssetclut
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 69 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ laye r id id in layer id ? vdc4_surface_graphics_ 1: gra phics surfa c e 1 ? vdc4_surface_graphics_ 2: gra phics surfa c e 2 ? vdc4_surface_graphics_ 3: graphics surface 3 vd c 4 _c lu t * table in pointer to clut parameter null shoul d not be sp ecifi ed. me m b ers of t h e struct ure vd c4_clut are sh ow n bel o w. typedef struct { _sint color_num ; _udword *clut ; } vdc4_clut ; ty pe member name input/ outpu t des c ription _sint color_ num in num ber of colors in clut. cl ut4 0 ~ 16 cl ut8 0 ~ 256 cl ut1 / argb155 5 ignored. 2 col ors sh ould be spe c ified a s cl ut data (cl u t) wh en clut 1 or arg b 1555 i s use d . _udwor d * clut in pointer to cl ut data in argb8 888 format (see figure 13) null shoul d not be sp ecifi ed. color data arrangement r ( 8bit s ) g (8bits) b (8bits) a (8bi t s ) ms b ls b 0x 00 ( 2 4 bit s ) a (8 b its) argb1555 clut8, clut4, clut1 figure 13 clut data arrangement fi gu re 1 3 s h o w s c l ut data arra ngem e nt . whe n ar gb 1 5 5 5 f o rm at is us ed , 8 b its alpha v a lu e is set i n th e msb. whe n cl ut 1 or ar gb1 5 5 5 fo rm at is used, clut is set to a po in ter to the bu ffer in wh ich two co lors are stored . th e first co lo r rep r esen ts a co lor d a ta wh en clut1 eq u a ls ?0 ?, and t h e sec ond c o lor re prese n ts a c o lor data when clut1 equals ? 1 ? . i n argb 15 5 5 fo rm at, the first c o lo r re p r esents a alpha value whe n al pha equals ?0?, a n d the second c o lor represe n ts a al pha val u e whe n alpha e q uals ?1?.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 70 of 105 apr 18, 2013 2.3.18 vdc4_disp la y calibrati on syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _di s play calib rati on( con s t vdc4_di s p c ali b ration *pa r am ) ; parameters ? [in]con s t vdc4 _di s p c alib rat i on *pa r am display calibration parameter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge vdc4_err_param_inv alid erro r co de no rmal en d. surface erro r. illegal state. param e ter e r ror. out of ra nge. param e ter e r ror. inv a lid pa ramete r. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? gamma co rrectio n is t u rn ed on /off. ? panel bri ght ne ss ad j u st m e nt param e t e rs are set . ? c ont ra st ad j u st m e nt param e t e rs a r e set . ? pan el d ith er correction p aram eters are set. ? th e co rrection circu it sequ en ce con tro l is set. in th is fun c tion, it is on ly ab le to turn o n / o f f g a mma co rrect io n . to set g a mma co rrection p a ram e ters, call vdc 4 _ dis p lay s etgam m a correctio nta b le. the pa nel di t h er out put fo rm at sel ect i s set aut o m a t i c al l y depe n d i n g on t h e out put f o rm at speci fi ed i n vdc 4_ in itiali ze.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 71 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vd c 4 _d is pc alib r a tion * param in display calibration parameter null should not be specified. me m b ers of t h e struct ure vd c4_dispcalibration are show n b e l o w. typedef struct { vdc4_calibrationpath path ; vdc4_onoff gam_on ; vdc4_calibr_bright *bright ; vdc4_calibr_contrast *contrast ; vdc4_calibr_dither *panel_dither ; } vdc4_dispcalibration ; ty pe member name input/ outpu t des c ription vdc4_c ali b rationpath path in co rre ction circuit se que nce cont rol ? vdc4_calibr_b c g: brightne ss -> contrast -> gamma correc tion ? vdc4_calibr_gb c: gamma co rre ction -> bri ght ness -> contrast vdc4 _onoff gam_ on in gamma co rre ction o n /of f control ? vdc4_of f ? vdc4_o n vdc4_c ali b r_ bright * brig ht in brightne ss dc pa ramete r settings will b e left uncha n ged if null i s sp ecifie d. vdc4_c ali b r_ cont ra st * cont ra st in cont ra st gain param eter settings will b e left uncha n ged if null i s sp ecifie d. vdc 4 _c a l ib r_d i th er * panel _dithe r in panel dith eri ng pa ramete r settings will b e left uncha n ged if null i s sp ecifie d.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 72 of 105 apr 18, 2013 me m b ers of t h e struct ure vd c4_calibr_bright are s h own below. typedef struct { _uword pbrt_g ; _uword pbrt_b ; _uword pbrt_r ; } vdc4_calibr_bright ; ty pe member name input/ outpu t des c ription _u wo rd pbrt_ g in brightne ss (dc) a d ju stmen t of g signal 0x0000 (-5 12 ) ~ 0x03f f (+511 ) _u wo rd pbrt_ b in brightne ss (dc) a d ju stmen t of b signal 0x0000 (-5 12 ) ~ 0x03f f (+511 ) _u wo rd pbrt_ r in brightne ss (dc) a d ju stmen t of r signal 0x0000 (-5 12 ) ~ 0x03f f (+511 ) me m b ers of t h e struct ure vd c4_calibr_contrast are show n b e l o w. typedef struct { _uword cont_g ; _uword cont_b ; _uword cont_r ; } vdc4_calibr_contrast ; ty pe member name input/ outpu t des c ription _uwo rd cont_ g in cont ra st (gai n) adj ustme nt of g signal 0x0000 (0/12 8 [times]) ~ 0 x 00ff (2 55/1 28 [times]) _uwo rd cont_ b in cont ra st (gai n) adj ustme n t of b signal 0x0000 (0/12 8 [times]) ~ 0 x 00ff (2 55/1 28 [times]) _uwo rd cont_ r in cont ra st (gai n) adj ustme nt of r signal 0x0000 (0/12 8 [times]) ~ 0 x 00ff (2 55/1 28 [times]) mem b ers of t h e struct ure vd c4_calibr_contrast are show n b e l o w. typedef struct { vdc4_pdthmode pdth_sel ; _uword pdth_pa ; _uword pdth_pb ; _uword pdth_pc ; _uword pdth_pd ; } vdc4_calibr_contrast ; ty p e member name input/ outpu t des c ription vdc4_pdthm ode pdth_ sel in panel dithe r ope ration mo de ? vd c4_pdth_md_tru : tr unc a tion ? vdc4_pdth_md_rdof: rou nd off ? vdc4_pdth_md_2x2: 2 x 2 pattern dither ? vd c4_pdth_md_r an d : random pattern dither _uwo rd pdth_p a in pattern value (a) of 2x2 pattern dither 0 ~ 3
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 73 of 105 apr 18, 2013 this m embe r is refe re nce d wh en p dth _sel i s set to vdc4_pdth_md_2x2. _u wo rd pdth_p b in pattern value (b) of 2x2 pattern dither 0 ~ 3 this member is referenced when pdth_sel is set to vdc4_pdth_md_2x2. _u wo rd pdth_p c in pattern value (c) of 2x2 p a ttern dither 0 ~ 3 this member is referenced when pdth_sel is set to vdc4_pdth_md_2x2. _u wo rd pdth_p d in pattern value (d) of 2x2 p a ttern dither 0 ~ 3 this member is referenced when pdth_sel is set to vdc4_pdth_md_2x2.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 74 of 105 apr 18, 2013 2.3.19 vdc4_disp la y setgam macorrecti ontable syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _di s playsetg am macorre c tion table ( con s t vdc4 _g amma co rre ct ion *table ) ; parameters ? [in]con s t vdc4 _gamm a correction * table gamma correction parameter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge erro r co de no rmal en d. surface error. illegal state. parameter error. out of range. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the gam m a correct i o n param e t e rs are i n di vi dual l y set f o r r g b si g n al s. in this fu nction , the pa ram e ter s re fer r ed to by gam m a corre ctio n p r o cess are set. to turn on /off g a mm a c o rrectio n, it is necessa ry to ca ll vdc 4_ displ a y c alibration. if t h is fun c tio n is no t called , th e p a ram e ters for g a mma co rrectio n will b e left un ch ange d sin ce a reset. for inform atio n ab ou t in itial v a lu e after a reset, see "sh72 6 8 grou p, sh7 269 grou p user?s manu al: hard ware (r01uh0 048 ej)".
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 75 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_ gamm aco rrectio n * table in gamma correction parameter null should not be specified. me m b ers of t h e struct ure vd c4_gammacorrection are show n b e l o w. typedef struct { vdc4_gamcrrct *gam_g ; vdc4_gamcrrct *gam_b ; vdc4_gamcrrct *gam_r ; } vdc4_gammacorrection ; ty pe member name input/ outpu t des c ription vdc4 _gamc r r c t * gam_ g in gamma co rre ction pa ram eter of g sig nal settings will b e left uncha n ged if null i s sp ecifie d. vdc4 _gamc r r c t * gam_ b in gamma co rre ction pa ram eter of b signal settings will b e left uncha n ged if null i s sp ecifie d. vdc4 _gamc r r c t * gam_ r in gamma co rre ction pa ram eter of r si gnal settings will b e left uncha n ged if null i s sp ecifie d. mem b ers of t h e struct ure vd c4_gamcrrct are s h ow n be l o w. typedef struct { _uword gam_th[ vdc4_gam_th_num ] ; _uword gam_gain[ vdc4_gam_gain_num ] ; } vdc4_gamcrrct ; ty p e member name input/ outpu t des c ription _uwo rd gam_th[ vdc4_gam_ t h_ num ] in start threshol d of area 1 to 31 of signal 0 ~ 255 the symb ol vdc4_gam _t h_ num is de fined as 3 1 . _uwo rd gam_ gain[ vdc4_gam _ g ain_ num ] in gain adj ustm ent of area 0 to 31 of signa l 0x0000 ~ 0x0 7 ff (0x0 400 =1.0[time s]) the symbol vdc4_gam _ g ain_ num i s defin ed a s 32.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 76 of 105 apr 18, 2013 2.3.20 vdc4_sw itchvs y nc syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _switchv sy n c ( vdc4 _on off freerunv sync, con s t vdc4 _s yncperi od *s yncperi od ) ; parameters ? [in]vdc4_o no ff freeru n vsync ? [in]con s t vdc4 _syncpe r iod * syncperiod free -runni ng vsync o n /o ff sync peri od p aram eter retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_ra n ge erro r co de no rmal en d. surface erro r. illegal state. param e ter e r ror. out of ra nge. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? th e v s yn c sign al to b e ou tput from the scaler is s w itche d. ? the sy nc peri o d param e t e rs are set . in th is fun c tion, th e vsy n c sign al to b e ou tput fro m th e scal er ca n be selected a n d the sync pe riod parameter can be set. th ese settin g s are p erform ed as p a rt of t h e i n itializat io n in th e fun ctio n vdc4_ in itialize (see 2 . 3 . 1), t h erefo r e it is no t always neces sa ry. ev en thou gh t h e d isp layed imag e m a y b e d isto r ted b y calling th is fu n c tion , it is no t con sidered in t h is vdc4 d r iv er. u s ers h a v e to co nsid er wh en t h e v s yn c should b e sw itch e d b y callin g t h is fun c tion .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 77 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc 4 _onoff free ru nvsyn c in free -runni ng vsync o n /o ff ? vdc4_of f: external input vsync si gnal ? vdc4_on: internally generated free-running vsync signal vdc4_syn cpe r iod * syncperi od in sync peri od p aram eter settings will b e left uncha n ged if null i s sp ecifie d. me m b ers of t h e struct ure vd c4_syncperiod are s h own below. typedef struct { _uword res_fv ; _uword res_fh ; } vdc4_syncperiod ; ty pe member name input/ outpu t des c ription _uwo rd re s_fv in free -runni ng vsync p erio d setting vsync p erio d = (res_fv + 1) x hsync pe ri od 0x0000 ~ 0x0 7 ff [lines] this pa ramet er is ignored, when free -runnin g vsync (free r unv sync) is set to vdc4_o ff. _uwo rd re s_fh in hsyn c pe rio d setting hsyn c pe rio d = (res_fh + 1 ) / pixel clock f r eq uen cy 0x0000 ~ 0x0 7ff [pixel clo ck cycle s ]
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 78 of 105 apr 18, 2013 2.3.21 vdc4_che ckclock syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _checkclo ck( vd c4 _pan elcl ocksel panel clo cks el, vdc4_p anel clkdcdr dcdr, _udword s r ccl k freq, v oid (*w aitm s e c ) ( _u d w or d )) ; parameters ? [in]vdc4_panelclocksel panel clo cks el ? [in]vdc4_pa n e lcl k dcdr dcd r ? [in]_udwo r d srccl k freq ? [in]void (*waitmsec)( _udword ) panel cl ock source sele ct panel cl ock freque ncy division ratio source cl ock frequ en cy pointer to the use r-d efined wait functio n retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus vdc4_err_param_undef vdc4_err_param_inv alid vdc4_err_system_pnlclk erro r co de no rmal en d. surface erro r. illegal state. param e ter e r ror. undefin e d . param e ter e r ror. inv a lid pa ramete r. system error. abnorm a l pa nel clo c k. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? the pa nel cl oc k s o urce sel ect and t h e pa nel c l ock fre q u ency di vi si on rat i o are set . ? free- r u n n i n g s y nc pe ri o d s a r e set . ? masking repea t ed vsync si gnals and c o m p ensa ting for m i s sing vsy n c si gnals are disa bl ed. ? tc on re gi st er u pdat e c o nt r o l re gi st er ( t c o n_ up d a te ) i s set . ? the wai t t i m e is cal cul a t e d fr o m free-ru n n i n g sync peri od s a n d s o u r ce cl oc k fre que ncy , a n d wai t pr oces si ng i s perf o r m e d by user - d efi n e d w a i t fu nct i o n . ? aft e r wai t pr oc essi ng , th e abn o rm al operat i o n of t h e pa nel cl ock i s det ect ed by chec ki n g tco n _ u p d ate. thi s fu nct i o n i s use d t o c h eck t h at t h e pa nel cl ock i n vdc 4 i s n o rm al or n o t . f o r c h ecki n g t h e pa nel cl o c k a n d ret r y i n g whe n a b no rm al ope rat i o n i s d e t ect ed, see sec t i on 4. 2. 2. the abn o rm a l oper a t i on of t h e pa nel cl oc k doe s not occ u r o n t h e fo llowing con d itio n s . table 16 co nditions of normal opera t ion panel clock freque nc y div i sion ratio video_x1 pin panel clock source sele ct 1/1, 1/2, 1/5, 1/9 all all video image clock (video_x1) 1/7 fixed peripheral clock 1 clo ck inp ut video imag e clo ck (video _x1) video image clock (video_x1) others fixed peripheral clock 1
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 79 of 105 apr 18, 2013 th is fun c tion sh ou ld b e called first afte r reset . t h ere f o r e, cl ock an d i/ o p o r t set t i ngs as fo l l o ws s h oul d b e d one be f o re calling this function. howe ve r, i/o port settings for the sync signal of the lc d m odule s h ould not be done . t o c h ec k th e p a n e l clo c k op eration , free-ru n n i ng syn c sig n a l setting s are d o n e i n th is fu n ction . if i/ o p o rt related to sy n c sign al is set as ou tpu t p in , illeg a l si g n a l m a y b e ou tpu t to th e lcd mo du le. ? su ppl y t h e cl o c k t o t h e v d c 4 m odul e. ? supply the clock to the digit al vi de o decoder m odule, if necessa ry. ? set i/o po rt fo r th e ex tern al clo c k (lc d _ e xtclk) or video im age clock (dv_cl k), if necessa ry. to c h ec k panel cl ock o p e r at i o n by t h i s fu nct i o n , t h e wai t pr o cessing is r e qu ir ed . th e w a it pr o cessing is p e rf or m e d b y th e user-d efin ed fun c tion sp ecified b y wait msec . a b out t h e i m pl em ent a t i on of use r - d e f i n e d f u nct i o n , see sect i o n 3.3 .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 80 of 105 apr 18, 2013 ar g u m e nt s set t i ngs ty pe parameter name input / outpu t des c ription vdc4_p anel clocksel panel clo cks el in panel cl ock source sele ct ? vdc4_l cdpanel_ c lks e l_img: video imag e clo ck (video _x1) ? vdc4_lcdpanel_clks e l_ext: external c lock (lcdext_clk) ? vdc4_lcdpanel _ c lks e l_peri: periph eral clo ck 1 ? vdc4_lcdpanel_c lksel_img_dv: video image clock (dv_clk) vdc4_p anel clkdcdr dc dr in panel cl ock freque ncy division ratio ? vdc4_l cdpanel_ c lk div_1_1: 1/1 ? vdc4_l cdpanel_ c lk div_1_2: 1/2 ? vdc4_l cdpanel_ c lk div_1_3: 1/3 ? vdc4_l cdpanel_ c lk div_1_4: 1/4 ? vdc4_l cdpanel_ c lk div_1_5: 1/5 ? vdc4_l cdpanel_ c lk div_1_6: 1/6 ? vdc4_l cdpanel_ c lk div_1_7: 1/7 ? vdc4_l cdpanel_ c lk div_1_8: 1/8 ? vdc4_l cdpanel_ c lk div_1_9: 1/9 ? vdc4_l cdpanel_ c lk div_1_1 2: 1/12 ? vdc4_l cdpanel_ c lk div_1_1 6: 1/16 ? vdc4_l cdpanel_ c lk div_1_2 4: 1/24 ? vdc4_l cdpanel_ c lk div_1_3 2: 1/32 _u dw or d srcclkfreq in source cl ock frequ en cy [hz] e.g., if source clock fre que ncy is 40 m h z, set ?400 00 000?. void (*w aitms ec )( _u dw or d ) in pointer to the use r-d efined wait functio n pointer to the wait function impleme n ted by the use r . this function will delay until an amount of tim e specified by the parameter (wait [millisec onds]) has el apsed. ?0? should not be specified. syntax void w a it_msec( _udw ord w a it ) ; parameters ? [in]_udwo r d wait wait time [msec ] retu rn values ? void de scriptio n wait processing implemented by the user is performed.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 81 of 105 apr 18, 2013 2.3.22 vdc4_res et syntax #incl ude "vdc4_ api.h" vdc4_e rrorcode vdc4 _reset ( void ) ; parameters ? [in]void retu rn values ? vdc4_e rrorcode vdc4_err_none vdc4_err_surfa c e_s t atus erro r co de no rmal en d. surface error. illegal state. descri pt i on in th is fun c tion, th e op eratio ns are perform ed as bel o w. ? so ft ware reset of v d c 4 m odul e i s per f o r m e d. ? so ft ware reset of v d c 4 m odul e is ca ncel ed. after this funct i on is called, vdc4 m odule will be the sam e state im m e diately after reset.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 82 of 105 apr 18, 2013 3. user-defined functions dri v er calls vdc4_ i n itialize and vdc 4_te rm inate allow execution of us er - d efi n ed f unc t i ons. a n d dri v er cal l vdc 4_ ch eckclo ck requ ires th e user-d efin ed wait fu n c tion. e x am pl es of th e user - d efi n e d fu nct i o n are sh ow n bel o w. 3.1 example of user-defined func tion w i thin vdc4_initialize 1 /**********************************************************************//** 2 * function name : init_vdc4_callback 3 * @brief 4 * @param [in]_udword mode 5 * @retval void 6 *************************************************************************/ 7 void init_vdc4_callback( _udword mode ) 8 { 9 /* vdc4 interrupt level 10 b11:b8 ----0101 -------- ; vi_vsync, lo_vsync, vsyncerr 11 b7:b4 -------- 0101---- ; vline, vfield 12 b3:b0 -------- ----0101 ; vbuferr1, 2, 3, 4 */ 13 intc.ipr10.word &= ~0x0fffu ; 14 intc.ipr10.word |= 0x0555u ; 15 16 /* standby control register 7 (stbcr7) 17 b3 ----0--- ; mstp73 : 0 : vdc4 enable */ 18 cpg.stbcr7.byte &= ~0x0008u ; 19 20 /* port g control register 0 21 b14:b12 -010---- -------- ; pg3md[2:0] : 010 : lcd_data3 22 b10:b8 -----010 -------- ; pg2md[2:0] : 010 : lcd_data2 23 b6:b4 -------- -010---- ; pg1md[2:0] : 010 : lcd_data1 24 b2:b0 -------- -----010 ; pg0md[2:0] : 010 : lcd_data0 */ 25 port.pgcr0.word = 0x2222u ; 26 /* port g control register 1 27 b14:b12 -010---- -------- ; pg7md[2:0] : 010 : lcd_data7 28 b10:b8 -----010 -------- ; pg6md[2:0] : 010 : lcd_data6 29 b6:b4 -------- -010---- ; pg5md[2:0] : 010 : lcd_data5 30 b2:b0 -------- -----010 ; pg4md[2:0] : 010 : lcd_data4 */ 31 port.pgcr1.word = 0x2222u ; 32 /* port g control register 2 33 b14:b12 -010---- -------- ; pg11md[2:0] : 010 : lcd_data11 34 b10:b8 -----010 -------- ; pg10md[2:0] : 010 : lcd_data10 35 b6:b4 -------- -010---- ; pg9md[2:0] : 010 : lcd_data9 36 b2:b0 -------- -----010 ; pg8md[2:0] : 010 : lcd_data8 */ 37 port.pgcr2.word = 0x2222u ; 38 /* port g control register 3 39 b13:b12 --10---- -------- ; pg15md[1:0] : 10 : lcd_data15 40 b9:b8 ------10 -------- ; pg14md[1:0] : 10 : lcd_data14 41 b5:b4 -------- --10---- ; pg13md[1:0] : 10 : lcd_data13 42 b1:b0 -------- ------10 ; pg12md[1:0] : 10 : lcd_data12 */ 43 port.pgcr3.word = 0x2222u ; 44 /* port g control register 4 45 b14:b12 -010---- -------- ; pg19md[2:0] : 010 : lcd_data19 46 b10:b8 -----010 -------- ; pg18md[2:0] : 010 : lcd_data18 47 b5:b4 -------- --10---- ; pg17md[1:0] : 10 : lcd_data17 48 b1:b0 -------- ------10 ; pg16md[1:0] : 10 : lcd_data16 */ 49 port.pgcr4.word = 0x2222u ;
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 83 of 105 apr 18, 2013 50 /* port g control register 5 51 b14:b12 -010---- -------- ; pg23md[2:0] : 010 : lcd_data23 52 b10:b8 -----010 -------- ; pg22md[2:0] : 010 : lcd_data22 53 b6:b4 -------- -010---- ; pg21md[2:0] : 010 : lcd_data21 54 b2:b0 -------- -----010 ; pg20md[2:0] : 010 : lcd_data20 */ 55 port.pgcr5.word = 0x2222u ; 56 /* port g control register 6 57 b13:b12 --11---- -------- ; pg27md[1:0] : 11 : lcd_extclk 58 b9:b8 ------10 -------- ; pg26md[1:0] : 10 lcd_tcon1 59 b5:b4 -------- --10---- ; pg25md[1:0] : 10 lcd_tcon0 60 b1:b0 -------- ------10 ; pg24md[1:0] : 10 lcd_clk */ 61 port.pgcr6.word = 0x3222u ; 62 /* port j control register 5 63 b14:b12 -011---- -------- ; pj23md[2:0] : 011 : lcd_tcon6 64 b10:b8 -----011 -------- ; pj22md[2:0] : 011 : lcd_tcon5 65 */ 66 port.pjcr5.word &= ~0x7700u ; 67 port.pjcr5.word |= 0x3300u ; 68 69 /* port j control register 7 70 b12 ---1---- -------- ; pj31md : 1 : dv_clk 71 */ 72 port.pjcr7.word |= 0x1000u ; 73 /* port e control register 1 74 b5:b4 -------- --11---- ; pe5md[1:0] : 11 : dv_hsync 75 b1:b0 -------- ------11 ; pe4md[1:0] : 11 : dv_vsync */ 76 port.pecr1.word |= 0x0033u ; 77 /* port j control register 0 78 b14:b12 -001---- -------- ; pj3md[2:0] : 001 : dv_data3 79 b10:b8 -----001 -------- ; pj2md[2:0] : 001 : dv_data2 80 b6:b4 -------- -001---- ; pj1md[2:0] : 001 : dv_data1 81 b2:b0 -------- -----001 ; pj0md[2:0] : 001 : dv_data0 82 */ 83 port.pjcr0.word &= ~0x7777u ; 84 port.pjcr0.word |= 0x1111u ; 85 /* port j control register 1 86 b14:b12 -001---- -------- ; pj7md[2:0] : 001 : dv_data7 87 b10:b8 -----001 -------- ; pj6md[2:0] : 001 : dv_data6 88 b6:b4 -------- -001---- ; pj5md[2:0] : 001 : dv_data5 89 b2:b0 -------- -----001 ; pj4md[2:0] : 001 : dv_data4 90 */ 91 port.pjcr1.word &= ~0x7777u ; 92 port.pjcr1.word |= 0x1111u ; 93 }
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 84 of 105 apr 18, 2013 3.2 example of user-defined func tion w i thin vdc4_ter minate 1 /******************************************************************//** 2 * function name : quit_vdc4_callback 3 * @brief 4 * @param [in]_udword mode 5 * @retval void 6 *********************************************************************/ 7 void quit_vdc4_callback( _udword mode ) 8 { 9 /* vdc4 interrupt level 10 b11:b8 ----0000 -------- ; vi_vsync, lo_vsync, vsyncerr 11 b7:b4 -------- 0000---- ; vline, vfield 12 b3:b0 -------- ----0000 ; vbuferr1, 2, 3, 4 */ 13 intc.ipr10.word &= ~0x0fffu ; 14 15 /* standby control register 7 (stbcr7) 16 b3 ----1--- ; mstp73 : vdc4 disable */ 17 cpg.stbcr7.byte |= 0x0008u ; 18 }
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 85 of 105 apr 18, 2013 3.3 example of user-defined func tion w i thin vdc4_checkclock whe n usi n g vdc4_ ch eck cl o ck, th e user-defin ed wait functio n is requ ired . two sam p le i m p l e m en tatio n are sh own bel o w. 3.3.1 compare match timer 1 /******************************************************************//** 2 * function name : wait_msec 3 * @brief compare match timer (1ch) to wait a msec 4 * @n clock select 5 * @n peripheral 0 clock 33.33mhz / 512 6 * @param [in]_udword wait : wait time in msec 7 * @retval void 8 *********************************************************************/ 9 void wait_msec( _udword wait ) 10 { 11 _udword compare ; 12 _uword reg ; 13 _udword pushreg ; 14 volatile _ubyte dummyread ; 15 16 pushreg = ( _udword )cpg.stbcr7.byte & 0x0004ul ; 17 /* standby control register 7 (stbcr7) 18 b3 -----0-- ; mstp72 : 0 : compare match timer enable */ 19 cpg.stbcr7.byte &= ( _ubyte )( ~0x0004u ) ; 20 /* dummy read */ 21 dummyread = cpg.stbcr7.byte ; 22 23 /* compare match timer control/status register 24 b7 ---- ---- 0--- ---- cmf: compare match flag; clearing 25 b6 ---- ---- -0-- ---- cmie: compare match interrupt enable; disabled 26 b1:b0 ---- ---- ---- --11 cks: clock select, p0/512 27 */ 28 cmt.cmcsr1.word = ( _uword )0x0003u ; 29 30 /* 1000usec / 15.36usec = 65.1 */ 31 compare = wait * 66ul ; 32 if( compare >= 0x00010000ul ) 33 { 34 compare = 0x0000fffful ; 35 } 36 /* compare match constant register */ 37 cmt.cmcor1.word = ( _uword )compare ; 38 /* compare match counter */ 39 cmt.cmcnt1.word = 0 ; 40 /* compare match timer start register 41 b1 ---- ---- ---- --1- str1: count start 1; started 42 */ 43 cmt.cmstr.word |= ( _uword )0x0002u ; 44 45 do 46 { 47 reg = ( _uword )( cmt.cmcsr1.word & 0x0080u ) ; 48 }
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 86 of 105 apr 18, 2013 49 while( reg == 0 ) ; 50 /* compare match timer start register 51 b1 ---- ---- ---- --0- str1: count start 1; stopped 52 */ 53 cmt.cmstr.word &= ( _uword )~0x0002u ; 54 55 /* compare match timer control/status register 56 b7 ---- ---- 0--- ---- cmf: compare match flag; clearing 57 */ 58 cmt.cmcsr1.word &= ( _uword )~0x0080u ; 59 60 if( pushreg != 0 ) 61 { /* standby control register 7 (stbcr7) 62 b3 -----1-- ; mstp72 : 1 : compare match timer disable */ 63 cpg.stbcr7.byte |= ( _ubyte )0x0004u ; 64 } 65 } in t h i s sam p l e code , 33 .3 3m hz peri phe ral cl ock 0 i s use d as a cl ock so u r ce f o r t h e c o m p are m a t c h tim e r m odul e. 3.3.2 bus y -w aiting 1 /******************************************************************//** 2 * function name : wait_msec 3 * @brief delya loop to wait a msec 4 * @param [in]_udword wait : wait time in msec 5 * @retval void 6 *********************************************************************/ 7 void wait_msec( _udword wait ) 8 { 9 _udword i, j ; 10 volatile _udword count ; 11 12 for( i = 0 ; i < wait ; i++ ) 13 { 14 count = 0 ; 15 /* the value '53368' is a number to wait a msec. 16 this value is depends on the environment (i.e., memory mapping, 17 memory caching, optimization, and etc.). */ 18 for( j = 0 ; j < 53368ul ; j++ ) 19 { 20 count++ ; 21 } 22 } 23 } the num b er of iterations for busy-wa iting de pends on t h e e nvi ronm ent (e.g., m e m o ry m a ppi ng, m e m o ry caching, and o p tim iza tio n ) an d pro cessing (e.g ., in terru p t serv ice rou tin e an d d i sp atch i n g task /th read ). if t h e os is availab l e, it is reco mm en d e d th at th e wait/d elay fun c tio n prov id ed b y th e os shou ld b e used .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 87 of 105 apr 18, 2013 4. example usage 4.1 the implementation of double buffering thi s dri v er p r o g ram pr ovi des t w o way s of d o ubl e b u f f eri n g . 4.1.1 double buffering provided b y vdc4 if t h e sec o nd f r a m e bu ffe r is s p ecified , do u b le b u f f eri n g is p e rf orm e d i n v d c 4 d r i v e r . w h en drawing is started o r frame bu ffe r is swa p ped , display e d fram e is specif i ed by fram e n u m b er. 4.1.2 double buffering in user applications in t h i s case , on l y fram e buf fer base ad dr e ss i s speci fied a nd single bufferi n g is perform ed in vdc 4 drive r . fram e buffe r base a d dress i s cha nge d wi t h cal l i ng vdc 4_ gra p hi csc h a n gepa ram and s p eci fi ed by fra m e bu ffe r a d d r ess.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 88 of 105 apr 18, 2013 4.2 example of processing flow 4.2.1 graphics 1 and graphi cs 2 vdc4_ initializ e() start end vdc4_ graphicscreatesurface() graphics (1) vdc4_ graphicscreatesurface() graphics (2) vdc4_ registcallbackfunc() vdc4_ graphicsalphablending() graphics (2) vdc4_ graphicsstartsurface() graphics (1) vdc4_ graphicschangeparam() graphics (2) rendering graphics with application program drvcall_ vdc4_ destroysurface graphics (1) vdc4_ graphicsstartsurface() graphics (2) vdc4_ terminate drvcall_ vdc4_ destroysurface graphics (2) preparation rendering termination sw ap b uf f er s checking vdc4 panel clock note: graphics 1 ? single buffer gra phi cs 2 ? doubl e buffe r / alpha blen ding figure 14 example of pr oces sing flow (gra phics 1 and grap hics 2) ab o u t c h ec ki n g vdc 4 pa nel cl ock (t he fi rst pr ocess i n figure 14), see sect ion 4. 2. 2.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 89 of 105 apr 18, 2013 4.2.2 detection of the abnormal panel clock and retry ing start end vdc4_ reset() setting standby control and i/o ports re t r y i n g o k vdc4_ checkclock() ng figure 15 example of pr oces sing flow for th e de tection o f the abnormal panel clock at first, th e sup p l y o f vdc4 clo c k and i/o p o rt settin gs are p e rfo r m e d . th en, th e p a n e l clo c k is ch eck e d b y callin g v d c 4_ ch eckclo ck . if vdc 4_c hec k clock returns vdc 4_err_none , it is end because the pa nel clock ope r ation is no rm al. if vd c 4_c heckc l oc k ret u r n s v d c 4 _ e r r _ s y st em _p nlc l k, t h e ret r y p r oce ssi ng s h o u l d b e d one beca use th e p a n e l clo c k op eration is ab norm a l. in t h e retr y pro c essin g , t h e p a n e l cl o c k is ch eck e d b y callin g vd c 4_c heckc l oc k, after vdc 4_ reset is called to reset vdc 4 .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 90 of 105 apr 18, 2013 4.3 setting example for lcd lcd setting p r o cessing is p e rform ed b y th e api fun ctio n vdc 4_ in itiali ze. th e relation s b e tween t h e sp ecification of th e lcd and t h e setting v a lues of a fu n c tion vdc 4_ in itialize are exp l ained b elow. 4.3.1 example of settings for the lcd that requires hs y nc an d vs y nc an exam pl e o f set t i ngs f o r t h e lc d t h at re q u i r es t h e ho ri z ontal sy nc ( h s y nc) si gnal a n d t h e vert i cal sy nc (vsy nc) si g n al i s as s h o w n bel o w . table 17 vdc4 settings for the l cd output pin s for the sig nal s to drive the lcd pan el hsy n c: lc d_ tco n 1 vs ync : lcd_tcon0 lcd tcon stva/vs: st va signal is u s ed a s vsyn c. sth/sp/hs: sth sig nal is used a s hsy n c. the source of the panel clock pe ripheral clock 1 (66.67mhz) vertical sync sign al output select inte rnally generated free-running vsync signal bit allocation of lcd sign als r[7:3]-g[7:2]-b[7:3] note: in addition to vdc4, a setu p of i/o ports is req u ire d to use outp u t pins l c d_t c o n 1 an d lcd_t c o n 0 . table 18 lcd specifica ti ons display si ze 480 x 272 output format rgb565 data sampli ng the falling edge of the panel clock sync sig nal polarity hsync: ne gat ive polarity vsync: negat ive polarity freq uen cy 8.0 ~ 9.0 mhz table 19 timing signals for driving the lcd pa nel signal sy mbol value ho rizontal pe riod hp 525 [clock] ho rizontal display period hdp 480 [clock] ho rizontal sync signal st art position hss 0 [clock] ho rizontal sync signal pu lse width hsw 41 [clock] ho rizontal back porch hbp 2 [clock] ho rizontal front porch hfp 2 [clock] vertical p eriod vp 286 [line] vertical di splay period vdp 272 [line] vertical sync sign al st art position vss 0 [line] vertical sync sign al pulse width vsw 10 [line] vertical b ack porch vbp 2 [line] vertical front porch vfp 2 [line] note: except for hss and vss, setting values are complied with lcd specification. setting values of hss and vss define the timing of the lcd sync signal from the vdc4 internal sync signal.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 91 of 105 apr 18, 2013 th e con t ro l ti min g fo r driv i n g th e lcd p a nel is as sh own b e low (see figu r e 16 ). l1 d480 l2 l272 d1 d2 d3 d479 hss vp vdp vsw vbp vfp vss hsync (lcd) vsync (lcd) vsync (vdc4) hp hdp hbp hfp hsw clk data hsync (lcd) hsync (vdc4) data hsync (vdc4): vdc4 internal horizontal sync signal vsync (vdc4): vdc4 internal vertical sync signal hsync (lcd): lcd horizontal sync signal vsync (lcd): lcd vertical sync signal clk: panel clock (pixel clock) data: data d1 ~ d48 0 ? data per pixe l l1 ~ l2 72 ? data pe r line figure 16 signal chan ging timing of the lcd dri v en b y hs y n c and vs y nc
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 92 of 105 apr 18, 2013 th e lc d settin gs are set to th e stru cture v dc4_initattr as f o llo ws whe n vdc4_ i n itialize is call e d . 1 vdc4_initattr initattr ; 2 vdc4_lcdtcontim lcdtcontim_stva_vs ; 3 vdc4_lcdtcontim lcdtcontim_sth_sp_hs ; 4 vdc4_lcdoutput lcdoutput ; 5 6 /* vsync */ 7 lcdtcontim_stva_vs.tcon_hsvs = ( _uword )( 0 * 2 ) ; 8 lcdtcontim_stva_vs.tcon_hwvw = ( _uword )( 10 * 2 ) ; 9 lcdtcontim_stva_vs.tcon_md = vdc4_lcd_tcon_polmd_normal ; 10 lcdtcontim_stva_vs.tcon_hs_sel = ( _uword )0 ; 11 lcdtcontim_stva_vs.tcon_inv = ( _uword )1 ; 12 lcdtcontim_stva_vs.tcon_pin = vdc4_lcd_tcon_pin_0 ; 13 lcdtcontim_stva_vs.outcnt_edge = vdc4_edge_rising ; 14 /* hsync */ 15 lcdtcontim_sth_sp_hs.tcon_hsvs = ( _uword )0 ; 16 lcdtcontim_sth_sp_hs.tcon_hwvw = ( _uword )41 ; 17 lcdtcontim_sth_sp_hs.tcon_md = vdc4_lcd_tcon_polmd_normal ; 18 lcdtcontim_sth_sp_hs.tcon_hs_sel = ( _uword )0 ; 19 lcdtcontim_sth_sp_hs.tcon_inv = ( _uword )1 ; 20 lcdtcontim_sth_sp_hs.tcon_pin = vdc4_lcd_tcon_pin_1 ; 21 lcdtcontim_sth_sp_hs.outcnt_edge = vdc4_edge_rising ; 22 /* lcd output control */ 23 lcdoutput.res_f.hs = ( _uword )43 ; 24 lcdoutput.res_f.hw = ( _uword )480 ; 25 lcdoutput.res_f.vs = ( _uword )12 ; 26 lcdoutput.res_f.vw = ( _uword )272 ; 27 lcdoutput.out_endian_on = vdc4_off ; 28 lcdoutput.out_swap_on = vdc4_off ; 29 lcdoutput.out_format = vdc4_lcd_outformat_rgb565 ; 30 lcdoutput.out_frq_sel = vdc4_lcd_parallel_clkfrq_1 ; 31 lcdoutput.out_dir_sel = ( _uword )0 ; 32 lcdoutput.out_phase = vdc4_lcd_serial_clkphase_0 ; 33 34 /* initialization parameter */ 35 initattr.vsel.freerunvsync = vdc4_on ; 36 initattr.vsel.res_fv = ( _uword )( 286 - 1 ) ; 37 initattr.vsel.res_fh = ( _uword )( 525 - 1 ) ; 38 initattr.sync = null ; 39 initattr.panel_icksel = vdc4_lcdpanel_clksel_peri ; 40 initattr.panel_dcdr = vdc4_lcdpanel_clkdiv_1_8 ; 41 initattr.tcon_half = ( _uword )262 ; 42 initattr.tcon_offset = ( _uword )0 ; 43 initattr.outcnt_lcd_edge = vdc4_edge_rising ; 44 initattr.outctrl[ vdc4_lcd_tconsig_stva_vs ] = &lcdtcontim_stva_vs ; 45 initattr.outctrl[ vdc4_lcd_tconsig_stvb_ve ] = null ; 46 initattr.outctrl[ vdc4_lcd_tconsig_sth_sp_hs ] = &lcdtcontim_sth_sp_hs ; 47 initattr.outctrl[ vdc4_lcd_tconsig_stb_lp_he ] = null ; 48 initattr.outctrl[ vdc4_lcd_tconsig_cpv_gck ] = null ; 49 initattr.outctrl[ vdc4_lcd_tconsig_pola ] = null ; 50 initattr.outctrl[ vdc4_lcd_tconsig_polb ] = null ; 51 initattr.outctrl[ vdc4_lcd_tconsig_de ] = null ; 52 initattr.settings = &lcdoutput ; 53 initattr.intenable_1 = vdc4_int_bit_vline ; 54 initattr.intenable_2 = vdc4_int_bit_none ;
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 93 of 105 apr 18, 2013 the a b ove sam p l e co de i s ex p l ai ned as f o l l o ws. 1. settin g vsyn c stva /vs signal g e n e r a ted b y lcd tcon is u s ed f o r t h e vsyn c sign al. the ti m i n g p a r a meter s of t h e v s yn c sign al are set in the struct ure vdc4_ lcdtcontim (lin e 7 - 1 3 ). and a po in ter t o th is stru ctu r e vdc4_lcdtcontim is set in th e array m e m b er outctrl (re fer re d t o by a n i nde x vdc4_lcd _tconsig_stva_vs ) in the stru ct u r e vdc4_initattr as stva/vs sign al settin gs (lin e 44). ? setting st ruct ure vdc4_lcd tcontim ? tcon_hsvs : the vert i cal sy nc si gnal st a r t po si t i on (v ss i n table 19) is specified in 1/ 2 cycles (line 7). ? tcon_hwvw : the vert i cal sy nc si gnal p u l se wi dt h (vs w i n table 19) is s p ecified in 1/2 cycles (line 8). ? tcon_md : in stva/vs signal settin g s, t h is p a ram eter is i g nored. ? tcon_hs_sel : in stva/ vs sign al settin gs, th is p a ram et er is igno red . ? tcon_inv : th e v ertical sync sign al is n e g a tiv e po larity (in tab l e 1 8 ), t h erefo r e th is p ara m eter is set to ?1 ? (lin e 1 1 ). ? tcon_pin : the vert i cal sy n c si g n al o u t p ut pi n i s lc d _ t c on 0 (i n tab l e 17 ), therefo r e th is p a ram e ter is set to vdc4_l cd_tcon_pin_0 (lin e 12 ). ? outcnt_edge : r i si ng e dge vdc4_edge_rising is sp ecified to syn c hron ize with th e lcd d ata si g n al (lin e 1 3 ). 2. settin g hsyn c sth/ s p / h s signal ge nerat e d by lcd tco n i s use d fo r t h e hsy n c sig n a l . the t i m i ng p a ram e t e rs of t h e hsy n c sig n a l are set i n th e stru cture vdc4_lcdtcontim (line 1 5 - 21 ). a n d a poi nter t o this structure vdc4_lcdtcontim is set in th e array m e m b er outctrl (re fer r e d to b y an in de x vdc4_lcd_tconsig_sth_sp_hs ) in the stru ct u r e vd c4_initattr as sth/sp/ hs sign al settin gs (lin e 46). ? setting st ruct ure vdc4_lcd tcontim ? tcon_hsvs : th e ho rizon t al sync sign al start po sitio n (hss in table 19) i s speci fied (line 15). ? tcon_hwvw : the h o ri zo nt al sy nc si g n al pul se wi dt h (h sw i n table 19) is specified (line 16). ? tcon_md : in sth/sp/hs sig n a l settin g s , th is p a ram e ter is ign o red. ? tcon_hs_sel : the horizontal refere nce offset control is not u s ed , th erefore th is p a rameter is set to ?0? (lin e 1 8 ). ? tcon_inv : the ho ri zo nt al s y nc si g n al i s n e gat i v e pol a r i t y (in tab l e 1 8 ), th erefo r e th is p a ram e ter is set to ?1 ? (line 19 ). ? tcon_pin : the ho ri zo nt al s y nc si g n al out p u t pi n i s lc d _ tc on 1 (i n table 17), t h ere f ore this pa ram e ter is set to vdc4_l cd_tcon_pin_1 (lin e 20 ). ? outcnt_edge : r i si ng e dge vdc4_edge_rising is sp ecified to syn c hron ize with th e lcd d ata si g n al (lin e 2 1 ). 3. settin g lc d ou tpu t the lc d output pa ram e ters are set in the structure vdc4_ lcdoutput ( l i n e 2 3 - 32 ). a n d a poi nt er t o t h i s structure vdc 4_lcdoutput is set in t h e me m b er settings in th e st ru ct u r e vdc4_ initattr (lin e 5 2 ). ? setting st ruct ure vdc4_lcd output ? res_f.hs : th e h o rizon t al enab le sign al start po sitio n (hss + hsw + hbp in table 19) is specifie d (li n e 23). ? res_f.hw : the horizontal e n able si g n al wi dt h ( h d p i n table 19) is s p eci fied (line 24). ? res_f.vs : th e v e rtical en ab le sign al start p o sitio n (vss + vsw + vbp in table 19) is s p ecified (line 25). ? res_f.vw : the vertical ena b le signal widt h (vdp in table 19) is s p ecified (line 26). ? out_endian_on : the lc d dat a si gnal i s out put m s b fi r s t (i n tab l e 17 ), th erefo r e th is p a ram e ter is set to vdc4_off (lin e 2 7 ). ? out_swap_on : the lc d da t a si gnal i s o u t put i n or der r g b (i n tab l e 17 ), th erefo r e this p a ram e ter is set to vdc4_off (lin e 2 8 ). ? out_format : th e lc d ou tp u t fo rm at is r g b565 (i n table 1 8 ), th erefo r e th is p aram ete r is set t o vdc4_lcd_outformat_rgb565 (lin e 29 ). ? out_frq_sel : w h en t h e lcd o u t p u t format is n o t serial rgb, th is p a ra m e ter is ig no red. ? out_dir_sel : w h en t h e lcd o u t p u t format is n o t serial rgb, th is p a ra m e ter is ig no red. ? out_phase : wh en t h e lc d ou tpu t fo rm at is no t serial r g b, t h is p a rameter is ign o red . 4. set t i ng ot he rs oth e r settin gs for th e lcd are set in t h e structu r e vdc4_i nitattr (lin e 3 5 - 43 ).
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 94 of 105 apr 18, 2013 ? setting st ruct ure vdc4_ini tattr ? vsel.freerunvsync : the in t e r n al l y ge nerat e d f r ee- r u nni ng ve rt i cal sync si g n al i s u s ed i n t h e v d c 4 (i n tab l e 1 7 ), t h erefore th is p a rameter is set to vdc4_on (line 35 ). ? vsel.res_fv : the free - r u nni ng ve rt i cal sy nc peri o d sh oul d be set t o t h e sam e val u e wi t h t h e lc d vert i cal sy nc peri o d , s o t h e vert i cal pe ri o d ( v p - 1 i n table 19) is s p ecified (line 36). ? vsel.res_fh : th e free-run n i n g horizon tal syn c p e riod sho u l d b e set t o th e sam e v a lu e with th e lc d ho ri zo nt al sy nc pe ri o d , s o t h e ho ri zo nt al pe ri od ( h p - 1 i n tab le 19) is sp ecified (lin e 37). ? panel_icksel : the peri ph eral b u s cl ock 1 i s use d as t h e so urce o f t h e panel cl ock (i n table 17), the r efore th is p a ram eter is set to vdc4 _lcdpanel_clksel_peri (lin e 39 ). ? panel_dcdr : the fre quenc y of the peri pheral bus cl ock 1 use d as t h e s o u r ce of t h e pa nel cloc k is 66 .6 7m hz (i n tabl e 17 ). to gene rat e t h e l c d panel cl oc k fre que ncy (8 . 0 ~ 9. 0m hz i n tabl e 18 ), t h e cl ock fre que ncy di vi si on rat i o n i s s e t t o vdc4_l cdpanel_clkdiv_1_8 ( 6 6. 67 / 8 = 8. 33 m h z, l i n e 4 0 ) . ? tcon_half : half o f th e ho rizo n t al p e riod (hp / 2 in table 19) is s p ecified (line 41). ? tcon_offset : the horizontal refere nce offset control is not u s ed , th erefore th is p a rameter is set to ?0? (lin e 4 2 ). ? outcnt_lcd_edge : th e lcd d a ta is latch e d at th e fallin g edg e of th e p a n e l cl o c k (i n table 18), s o t h e lcd d a ta sh ould b e ou tpu t at th e rising edg e . th is p a ram e te r is set t o vdc 4_edge_rising (lin e 43 ).
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 95 of 105 apr 18, 2013 4.3.2 example of settings for the lcd that requires hs y nc an d de an exam ple of settings for t h e lcd t h at re q u i r es t h e ho ri z ontal sy nc ( h s y nc) si gnal a n d t h e data ena b l e ( d e) si g n al i s as show n b e l o w . table 20 vdc4 settings for the l cd output pin s for the sig nal s to drive the lcd pan el hsy n c: lc d_ tco n 1 de: lc d_t c on5 lcd tcon sth/sp/hs: sth signal is used a s hsy n c. de: de s i gnal is us ed as de. stvb/ve: st vb signal is u s ed a s ve. stb/lp/he: stb signal i s use d as he. the source of the panel cl o ck pe ripheral clock 1 (66.67mhz) vertical sync sign al output select inte rnally generated free-running vsync signal bit allocation of lcd sign als r[7:2]-g[7:2]-b[7:2] note: in addition to vdc4, a setu p of i/o ports is req u ire d to use outp u t pins l c d_t c o n 1 an d lcd_t c o n 5 . table 21 lcd specificati ons display si ze 240 x 320 output format rgb6 66 data sampli n g the falling edge of the panel clock sync sig nal p o larity hsync: negative polarity de: positive pola r ity freq uen cy 5.0 ~ 6.0 mhz table 22 timing signals for driving the lcd pa nel signal sy mbol value ho rizontal pe riod hp 273 [clock] ho rizontal di splay peri od hdp 240 [clock] ho rizontal sy nc signal st art position hss 0 [clock] ho rizontal sy nc signal pulse width hsw 5 [clock] data en able signal start position des 22 [clock] vertical p e riod vp 327 [line] vertical di spl ay period vdp 320 [line] note: except for hss, setting values are complied with lcd specification. setting value of hss defines the timing of the lcd sync signal from the vdc4 internal sync signal.
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 96 of 105 apr 18, 2013 the de si g n al i s ge nerat e d by sy nt hesi zi ng ( an d ) t h e h o ri z ont al e n abl e ( he) si g n al a n d t h e vert i cal e n abl e ( ve ) si gn al . th e tim in g o f th e he si g n a l an d th e ve signal to g e n e rate th e de si g n a l is shown in tabl e 23. th e setting valu e for ves i n table 23 is als o refe rre d to as the vertical en ab le sign al start p o siti on. the vert i cal ena b l e si gnal st a r t p o s i t i on m u st be s e t t o 4 l i n es or great er beca use of th e li m ita ti o n of t h e vdc 4 . th erefo r e ves sh ou ld b e bet w ee n 4 li n e s and t h e vert i cal blan ki n g per i od. table 23 timing signals to gen e ra te de signal signal sy mbol value vertical e nabl e sign al sta rt position ves 7 [line]* (= vp - vdp) vertical e nabl e sign al pul se width vew 320 [line] (= vdp ) ho rizontal en able si gnal start po sition hes 22 [clo ck] (= hs s + de s ) ho rizontal en able si gnal p ulse width hew 240 [clock] (= hdp) note: * setting value of ves (vp - vdp) me an s a blanki ng p e rio d .
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 97 of 105 apr 18, 2013 th e con t ro l ti min g fo r driv i n g th e lcd p a nel is as sh own b e low (see figu r e 17 ). hsw hss ves vew hew hes hp hdp hsw hsync (vdc4) data de ve (vdc4) vsync (vdc4) he (vdc4) de hsync (lcd) clk data hsync (lcd) d1 d240 d2 d3 d239 l1 l2 l320 des vp vdp vsync (vdc4): vdc4 internal vertical sync signal hsync (vdc4): vdc4 internal horizontal sync signal ve (vdc4): vdc4 internal vertical enable signal he (vdc4): vdc4 internal horizontal enable signal hsync (lcd): lcd horizontal sync signal de: lcd data enable signal clk: panel clock (pixel clock) data: data d1 ~ d24 0 ? data per pixe l l1 ~ l3 20 ? data pe r line figure 17 signal chan ging timing of the lcd dri v en b y hs y n c and de
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 98 of 105 apr 18, 2013 th e lc d settin gs are set to th e stru cture v dc4_initattr as f o llo ws whe n vdc4_ i n itialize is call e d . 1 vdc4_initattr initattr ; 2 vdc4_lcdtcontim lcdtcontim_sth_sp_hs ; 3 vdc4_lcdtcontim lcdtcontim_stvb_ve ; 4 vdc4_lcdtcontim lcdtcontim_stb_lp_he ; 5 vdc4_lcdtcontim lcdtcontim_de ; 6 vdc4_lcdoutput lcdoutput ; 7 8 /* ve */ 9 lcdtcontim_stvb_ve.tcon_hsvs = ( _uword )( 2 * 2 ) ; 10 lcdtcontim_stvb_ve.tcon_hwvw = ( _uword )( 320 * 2 ) ; 11 lcdtcontim_stvb_ve.tcon_md = vdc4_lcd_tcon_polmd_normal ; 12 lcdtcontim_stvb_ve.tcon_hs_sel = ( _uword )0 ; 13 lcdtcontim_stvb_ve.tcon_inv = ( _uword )0 ; 14 lcdtcontim_stvb_ve.tcon_pin = vdc4_lcd_tcon_pin_non ; 15 lcdtcontim_stvb_ve.outcnt_edge = vdc4_edge_rising ; 16 /* he */ 17 lcdtcontim_stb_lp_he.tcon_hsvs = ( _uword )22 ; 18 lcdtcontim_stb_lp_he.tcon_hwvw = ( _uword )240 ; 19 lcdtcontim_stb_lp_he.tcon_md = vdc4_lcd_tcon_polmd_normal ; 20 lcdtcontim_stb_lp_he.tcon_hs_sel = ( _uword )0 ; 21 lcdtcontim_stb_lp_he.tcon_inv = ( _uword )0 ; 22 lcdtcontim_stb_lp_he.tcon_pin = vdc4_lcd_tcon_pin_non ; 23 lcdtcontim_stb_lp_he.outcnt_edge = vdc4_edge_rising ; 24 /* de */ 25 lcdtcontim_de.tcon_hsvs = ( _uword )0 ; 26 lcdtcontim_de.tcon_hwvw = ( _uword )0 ; 27 lcdtcontim_de.tcon_md = vdc4_lcd_tcon_polmd_normal ; 28 lcdtcontim_de.tcon_hs_sel = ( _uword )0 ; 29 lcdtcontim_de.tcon_inv = ( _uword )0 ; 30 lcdtcontim_de.tcon_pin = vdc4_lcd_tcon_pin_5 ; 31 lcdtcontim_de.outcnt_edge = vdc4_edge_rising ; 32 /* hsync */ 33 lcdtcontim_sth_sp_hs.tcon_hsvs = ( _uword )0 ; 34 lcdtcontim_sth_sp_hs.tcon_hwvw = ( _uword )5 ; 35 lcdtcontim_sth_sp_hs.tcon_md = vdc4_lcd_tcon_polmd_normal ; 36 lcdtcontim_sth_sp_hs.tcon_hs_sel = ( _uword )0 ; 37 lcdtcontim_sth_sp_hs.tcon_inv = ( _uword )1 ; 38 lcdtcontim_sth_sp_hs.tcon_pin = vdc4_lcd_tcon_pin_1 ; 39 lcdtcontim_sth_sp_hs.outcnt_edge = vdc4_edge_rising ; 40 /* lcd output control */ 41 lcdoutput.res_f.hs = ( _uword )22 ; 42 lcdoutput.res_f.hw = ( _uword )240 ; 43 lcdoutput.res_f.vs = ( _uword )2 ; 44 lcdoutput.res_f.vw = ( _uword )320 ; 45 lcdoutput.out_endian_on = vdc4_off ; 46 lcdoutput.out_swap_on = vdc4_off ; 47 lcdoutput.out_format = vdc4_lcd_outformat_rgb666 ; 48 lcdoutput.out_frq_sel = vdc4_lcd_parallel_clkfrq_1 ; 49 lcdoutput.out_dir_sel = ( _uword )0 ; 50 lcdoutput.out_phase = vdc4_lcd_serial_clkphase_0 ; 51 52 /* initialization parameter */ 53 initattr.vsel.freerunvsync = vdc4_on ; 54 initattr.vsel.res_fv = ( _uword )( 327 - 1 ) ; 55 initattr.vsel.res_fh = ( _uword )( 273 - 1 ) ;
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 99 of 105 apr 18, 2013 56 initattr.sync = null ; 57 initattr.panel_icksel = vdc4_lcdpanel_clksel_peri ; 58 initattr.panel_dcdr = vdc4_lcdpanel_clkdiv_1_12 ; 59 initattr.tcon_half = ( _uword )136 ; 60 initattr.tcon_offset = ( _uword )0 ; 61 initattr.outcnt_lcd_edge = vdc4_edge_rising ; 62 initattr.outctrl[ vdc4_lcd_tconsig_stva_vs ] = null ; 63 initattr.outctrl[ vdc4_lcd_tconsig_stvb_ve ] = &lcdtcontim_stvb_ve ; 64 initattr.outctrl[ vdc4_lcd_tconsig_sth_sp_hs ] = &lcdtcontim_sth_sp_hs ; 65 initattr.outctrl[ vdc4_lcd_tconsig_stb_lp_he ] = &lcdtcontim_stb_lp_he ; 66 initattr.outctrl[ vdc4_lcd_tconsig_cpv_gck ] = null ; 67 initattr.outctrl[ vdc4_lcd_tconsig_pola ] = null ; 68 initattr.outctrl[ vdc4_lcd_tconsig_polb ] = null ; 69 initattr.outctrl[ vdc4_lcd_tconsig_de ] = &lcdtcontim_de ; 70 initattr.settings = &lcdoutput ; 71 initattr.intenable_1 = vdc4_int_bit_vline ; 72 initattr.intenable_2 = vdc4_int_bit_none ; the a b ove sam p l e co de i s ex p l ai ned as f o l l o ws. 1. settin g ve stvb / v e si g n a l gene rat e d by lc d tc o n i s use d fo r t h e v e si g n al . t h e t i m i ng pa ram e t e rs of t h e ve si gnal a r e set in th e stru ct u r e vdc4_lcdtcontim (line 9 - 15). and a poi nter t o this structure vdc 4_lcdtcontim is set in t h e a r r a y me mb e r outctrl (ref e rre d t o by a n i nde x vdc4_l cd_tconsig_stvb_ve ) i n the structure vdc4_initattr as stvb/ v e si g n a l settin gs (lin e 63). ? setting st ruct ure vdc4_lcd tcontim ? tcon_hsvs : the vertical enable sign al start p o sitio n (ves in table 23) is specifie d in 1/ 2 cycles (line 9). ? tcon_hwvw : the vertical enable sign al pul se wi dt h (v ew i n table 23) is specifie d in 1/ 2 cycles (line 10). ? tcon_md : in stvb/ve signal settin g s, t h is p a ram eter is i g nored. ? tcon_hs_sel : in stvb/ve sign al setting s , th is p a ram e ter is ign o red. ? tcon_inv : the vert i cal ena b l e sig n al i s no t out put , s o t h i s pa ram e t e r do es n o t af fect a n y t hi ng. ? tcon_pin : th e v e rtical en ab le sign al is n o t o u t p u t , th erefo r e th is p a ram e ter is set to vdc4_lcd_tcon_pin_non (lin e 14 ). ? outcnt_edge : th e v e rtical en ab le sign al i s no t o u t p u t , so th is p a ram e ter is ign o red. 2. settin g he stb / lp/ h e si gnal ge nerat e d by lcd tco n i s use d fo r t h e he si gnal . the t i m i ng par a m e t e rs of t h e he si gnal a r e set in th e stru ctu r e vdc4_lc dtcontim (lin e 1 7 - 23 ). and a po in ter to t h is stru cture v dc4_lcdtcontim is set in th e array m em b er outctrl (re fer r e d to b y an in de x vd c4_lcd_tconsig_stb_lp_he ) in the s t ructure vdc4_initattr as stvb/ v e si g n a l settin gs (lin e 65). ? setting st ruct ure vdc4_lcd tcontim ? tcon_hsvs : the horizontal enable sign al start po sitio n (hes in table 23) is speci fied (line 17). ? tcon_hwvw : the horizontal enable si gn al pu lse w id th (h ew in table 23) is specifie d (li n e 18). ? tcon_md : in stb/lp/he sig n al settin g s , th is p aram eter is ign o red. ? tcon_hs_sel : the horizontal refere nce offset control is not u s ed , th erefore th is p a rameter is set to ?0? (lin e 2 0 ). ? tcon_inv : the ho ri zo nt al e n abl e si g n al i s not o u t p ut , s o t h i s param e t e r doe s not a ffect any t hi n g . ? tcon_pin : th e h o rizon t al enab le sign al is n o t ou tpu t , th erefore th is p a rameter is set to vdc4_lcd_tcon_pin_non (lin e 22 ). ? outcnt_edge : th e ho rizontal en ab le si g n al is no t ou tpu t , so th is p a rameter is ign o red. 3. settin g de de si g n al g e n e rated b y lc d tcon is u sed for th e de signal. th e ti m i n g p aram eters of th e de si g n al are set in th e structure vdc 4_lcdtcontim (lin e 25 - 31 ). and a po in t e r to th is stru ct u r e vdc4_lc dtcontim is set in th e a r r a y me mb e r outctrl (ref e rre d t o by a n i nde x vdc4_l cd_tconsig_de ) in the st ructure vdc4_ initattr as stvb/ve sig n a l setting s (lin e 69 ). ? setting st ruct ure vdc4_lcd tcontim
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 100 of 105 apr 18, 2013 ? tcon_hsvs : in de sign al settin g s , t h is p a rameter is ig no red . ? tcon_hwvw : in de sign al settin g s , t h is p a rameter is ig no red. ? tcon_md : in de si g n al settin gs, t h is p a rameter is ign o red . ? tcon_hs_sel : in de sign al settin g s , t h is p aram eter is ign o red . ? tcon_inv : th e d a ta en ab le sig n a l is po sitiv e p o l arity (in tab l e 2 1 ), t h erefore th is p a rameter is set to ?0? (lin e 2 9 ). ? tcon_pin : th e d a ta en ab le sign a l ou tpu t pin is lc d_ tc on5 (in tab l e 2 0 ), th erefo r e t h is p aram eter is set to vdc4_lcd _tcon_pin_5 (lin e 30 ). ? outcnt_edge : r i si ng e dge vdc4_edge_rising is sp ecified to syn c hron ize with th e lcd d ata si g n al (lin e 3 1 ). 4. settin g hsyn c sth/ s p/ h s si gnal ge nerat e d by lc d tc o n i s use d fo r h sy n c si g n al . th e t i m i ng pa ram e t e rs o f t h e hs y n c si g n al are set in the struct ure vdc4_ lcdtcontim (lin e 33 - 39). and a po in ter t o th is stru ctu r e vdc4_lcdtcontim is set in th e array m e m b er outctrl (re fer re d t o by a n i nde x vdc4_lcd _tconsig_sth_sp_hs ) i n the structure vdc4_initattr as sth/sp/hs sign al settin g s (lin e 6 4 ). ? setting st ruct ure vdc4_lcd tcontim ? tcon_hsvs : th e ho rizon t al sync sign al start po sitio n (hss in table 22) i s speci fied (line 33). ? tcon_hwvw : the h o ri zo nt al sy nc si g n al pul se wi dt h (h sw i n table 22) is specified (line 34). ? tcon_md : in sth/sp/hs sig n a l settin g s , th is p a ram e ter is ign o red. ? tcon_hs_sel : the horizontal refere nce offset control is not u s ed , th erefore th is p a rameter is set to ?0? (lin e 3 6 ). ? tcon_inv : the ho ri zo nt al s y nc si g n al i s n e gat i v e pol a r i t y (in tab l e 2 1 ), th erefo r e th is p a ram e ter is set to ?1 ? (line 37 ). ? tcon_pin : the ho ri zo nt al s y nc si g n al out p u t pi n i s lc d _ tc on 1 (i n table 20), t h ere f ore this pa ram e ter is set to vdc4_l cd_tcon_pin_1 (lin e 38 ). ? outcnt_edge : r i si ng e dge vdc4_edge_rising is sp ecified to syn c hron ize with th e lcd d ata si g n al (lin e 3 9 ). 5. settin g lc d ou tpu t the lc d output pa ram e ters are set in the structure vdc4_ lcdoutput ( l i n e 4 1 - 50 ). a n d a poi nt er t o t h i s structure vdc 4_lcdoutput is set in t h e me m b er settings in th e st ru ct u r e vdc4_ initattr (lin e 7 0 ). ? setting st ruct ure vdc4_lcd output ? res_f.hs : th e h o rizon t al en ab le sign al start po sitio n (hes in table 23) is speci fied (line 41). ? res_f.hw : the horizontal e n able si g n al wi dt h ( h d p i n table 22) is s p eci fied (line 42). ? res_f.vs : the vertical ena b le signal start position (ves i n table 23) is specified (line 43). ? res_f.vw : the vertical ena b le signal widt h (vdp in table 22) is s p ecified (line 44). ? out_endian_on : the lc d dat a si gnal i s out put m s b fi r s t (i n tab l e 20 ), th erefo r e th is p a ram e ter is set to vdc4_off (lin e 4 5 ). ? out_swap_on : the lc d da t a si gnal i s o u t put i n or der r g b (i n tab l e 20 ), th erefo r e this p a ram e ter is set to vdc4_off (lin e 4 6 ). ? out_format : th e lc d ou tp u t fo rm at is r g b666 (i n table 2 1 ), th erefo r e th is p aram ete r is set t o vdc4_lcd_outformat_rgb666 (lin e 47 ). ? out_frq_sel : w h en t h e lcd o u t p u t format is n o t serial rgb, th is p a ra m e ter is ig no red. ? out_dir_sel : w h en t h e lcd o u t p u t format is n o t serial rgb, th is p a ra m e ter is ig no red. ? out_phase : wh en t h e lc d ou tpu t fo rm at is no t serial r g b, t h is p a rameter is ign o red . 6. set t i ng ot he rs oth e r settin gs for th e lcd are set in t h e structu r e vdc4_i nitattr (lin e 5 3 - 61 ). ? setting st ruct ure vdc4_ini tattr ? vsel.freerunvsync : the in t e r n al l y ge nerat e d f r ee- r u nni ng ve rt i cal sync si g n al i s u s ed i n t h e v d c 4 (i n tab l e 2 0 ), t h erefore th is p a rameter is set to vdc4_on (line 53 ). ? vsel.res_fv : the free - r u nni ng ve rt i cal sy nc peri o d sh oul d be set t o t h e sam e val u e wi t h t h e lc d vert i cal sy nc peri o d , s o t h e vert i cal pe ri o d ( v p - 1 i n table 22) is s p ecified (line 54). ? vsel.res_fh : th e free-run n i n g horizon tal syn c p e riod sho u l d b e set t o th e sam e v a lu e with th e lc d ho ri zo nt al sy nc pe ri o d , s o t h e ho ri zo nt al pe ri od ( h p - 1 i n tab le 22) is sp ecified (lin e 55). ? panel_icksel : the peri ph eral b u s cl ock 1 i s use d as t h e so urce o f t h e panel cl ock (i n table 20), the r efore th is p a ram eter is set to vdc4 _lcdpanel_clksel_peri (lin e 57 ).
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 101 of 105 apr 18, 2013 ? panel_dcdr : the fre quenc y of the peri pheral bus cl ock 1 use d as t h e s o u r ce of t h e pa nel cl oc k i s 66 .6 7m hz (i n tabl e 20 ). to gene rat e t h e l c d panel cl oc k fre que ncy (5 . 0 ~ 6. 0m hz i n tabl e 21 ), t h e cl ock fre que ncy di vi si on rat i o n i s s e t t o vdc4_l cdpanel_clkdiv_1_12 (6 6.67 / 12 = 5 . 5 6 m h z , lin e 58 ). ? tcon_half : half o f th e ho rizo n t al p e riod (hp / 2 in table 22) is s p ecified (line 59). ? tcon_offset : th e horizon tal referen c e offset con t ro l is no t us ed, th erefo r e th is p a ram e ter is set to ?0? (lin e 60 ). ? outcnt_lcd_edge : th e lcd d a ta is latch e d at th e fallin g edg e of th e p a n e l cl o c k (i n table 21), s o t h e lcd d a ta sh ould b e ou tpu t at th e rising edg e . th is p a ram e te r is set t o vdc 4_edge_rising (lin e 61 ).
SH7268/sh7269 group vdc4 driver user?s manual r01a n0 778e j01 00 rev.1 . 00 page 102 of 105 apr 18, 2013 web site and support r e nesas el ect r oni cs w e bsi t e h ttp ://www.renesas.co m / inqu iries http://www.renesas.com /inqui ry all tradem arks and registere d tradem arks ar e the property of their res p ective owne rs.
a-1 revision record des c ription rev . da te page summar y 1.00 apr.18.2013 ? first edition issued
general precautions in the handling of mpu/mcu products th e fo llowing u s ag e n o t es are app licab le to all mpu/mcu p r od u c ts fro m ren e sas. fo r detailed u s ag e no tes o n th e pr o duct s c o ver e d by t h i s m a nual , refe r t o t h e rel e va nt s ect i o ns of t h e m a nu al . if t h e desc ri pt i o n s un der g e neral preca utions in the ha ndling of mpu/ mcu products and i n the body of t h e m a nual diffe r from each othe r, t h e descri ption in t h e body of the manual takes precede n ce. 1. han d ling of unused pin s han d le un used pin s in accord with the d i re ction s give n unde r hand ling of unu s e d pins in the manu al. ? the inp u t pin s of cmos p r odu cts a r e ge nerally in the high -impe dan ce state. in o peration with an unu sed pi n in the open -ci r cuit state, extra elect r oma g netic noi se i s indu ced in th e vicinity of lsi, an asso ciated sh oot-throug h current flows intern ally, and malfunctio n s occur d ue to the false re cog nition of the pin state as an in put si gnal be co me possibl e. unu s ed pi ns sho uld be ha ndle d as describe d un der han d ling of unu s ed pi ns in the ma n ual. 2. processin g at power-o n the state of the produ ct is undefin ed at the mome nt when po we r is sup plied. ? the state s of intern al circui ts in the lsi are ind etermi n ate and the st ates of re gist er settings a n d pins a r e u nde fined at the moment when power i s su p p lied. in a finished pro du c t whe r e the re set si gnal is a pplie d to the external re set pin, the states of pins are n o t guara n teed from th e moment wh en po we r is supplie d until the re set pr ocess is compl e ted. in a similar way, the states of pins in a p r od uc t that is re set by an o n -chip p o wer-on re set fun c tion are n o t guara n teed from th e moment wh en po we r is supplie d until the po we r rea c he s the level at whi c h resetting has b een specifie d. 3. prohibitio n of access to re se rved add r e s ses access to re served a ddresse s is p r ohi bited. ? the re se rved addresse s are provid ed for the possible future expa nsi on of functio n s. do n o t acce ss these a dd r e s se s; the co rre ct ope ration o f ls i is not guara n teed if they are a c cessed. 4. clo ck sig nal s after applying a reset, only rele ase the re set line after t he ope ratin g clo ck sign al h as be co me st able. whe n switchi ng the clo c k signal du rin g p r og ram ex e c u t ion, wait until the target clo ck sign al ha s stabili zed. ? when the clock signal is gene rated with an external resonator (or from an exter nal oscillator) duri ng a reset , ensure that the reset line i s only re l e ased after full st abilization of the clock signal. more over, wh en switchi ng to a clo ck sign al pro du c ed with an external re so nator (or by an exte rnal oscillator) whi le program ex ecution is in progress, wait until t he target clock signal is stabl e. 5. differe nces b etwee n prod ucts before chan g ing from on e pro d u c t to another, i.e. to one with a differe nt type number, confirm that the cha nge will n o t lead to pro b lem s . ? the characteristics of mpu/mcu in the same group but having different type numbers may differ because of the differences in internal memory capacity and layout pattern. when changing to products of different type numbers, implement a system-evaluation test for each of the products.
notice 1. descriptions of circuits, software and other related information in this document are provided only to illustrate the operati on of semiconductor products and application examples. you are fully responsible for the incorporation of these circuits, software, and information in the design of your equipment. renesas electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information. 2. renesas electronics has used reasonable care in preparing the information included in this document, but renesas electronics does not warrant that such information is error free. renesas electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information incl uded herein. 3. renesas electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rig hts of third parties by or arising from the use of renesas electronics products or technical information described in this document. no license, express, implied or otherwise, is granted hereby under any paten ts, copyrights or other intellectual property rights of renesas electronics or others. 4. you should not alter, modify, copy, or otherwise misappropriate any renesas electronics product, whether in whole or in part. renesas electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration, modification, copy or otherwise misappropriation of renesas electronics product. 5. renesas electronics products are classified according to the following two quality grades: "standard" and "high quality". th e recommended applications for each renesas electronics product depends on the product's quality grade, as indicated below. "standard": computers; office equipment; communications equipment; test and equipment; and industrial robots etc. "high quality": transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster syst ems; anti-crime systems; and safety equipment etc. renesas electronics products are neither intended nor authorized for use in products or systems that may pose a direct t hreat to human life or bodily injury (artificial implantations etc.), or may cause serious property damages (nuclear reactor control systems, military equipment etc.). you must check the quality grade of each renesas electronics product before using it in a particular application. you may not use any renesas electronics product for any application for which it is not intended. renesas electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any renesas electronics product for which the product is not intended by renesas electronics. 6. you should use the renesas electronics products described in this document within the range specified by renesas electronics, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. renesas e lectronics shall have no use of renesas electronics products beyond such specified ranges. 7. although renesas electronics endeavors to improve the quality and reliability of its products, semiconductor products have sp ecific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. further, renesas electronics products are not subject to radiation resistance desig n. please be sure to implement possibility of physical injury, and injury or damage caused by fire in redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. because the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or systems manufactured by you. 8. please contact a renesas electronics sales office for details as to products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substan ces, including without limitation, the eu rohs directive. renesas electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations. 9. renesas electronics products and technology may not be used for or incorporated into any products or systems whose manufactur e, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. you should not use renesas electronics products or technology described in this document for any purpose relating to military applications or use by the military, including but not limited to the development of weapons of mass destruction. when exporting the renesas regulations and follow the procedures required by such laws and regulations. 10. it is the responsibility of the buyer or distributor of renesas electronics products, who distributes, disposes of, or other wise places the product with a third party, to notify such third party in advance of the contents and conditions set forth in this document, renesas electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of renesas electronics products. 11. this document may not be reproduced or duplicated in any form, in whole or in part, without prior written consent of renesas electronics. 12. please contact a renesas electronics sales office if you have any questions regarding the information contained in this docu ment or renesas electronics products, or if you have any other inquiries. (note 1) "renesas electronics" as used in this document means renesas electronics corporation and also includes its majority-own ed subsidiaries. (note 2) "renesas electronics product(s)" means any product developed or manufactured by or for renesas electronics. the event of the failure of a renesas electronics product, such as safety design for hardware and software including but not li mited to environmenta l matters such as the environmental compatibility of each renesas electronics product. please use renesas electron ics liability for malfunctions or damages arising out of the safety measures to guard them against the life support devices or systems, surgical http://www.renesas.com 11f., samik lavied' or bldg., 720-2 yeoksam-dong, kangnam-ku, seoul 135-080, korea tel: +82-2-558-3737, fax: +82-2-558-5141 unit 906, block b, menara amcorp, amcorp trade centre, no. 18, jln persiaran barat, 46050 petaling jaya, selangor darul ehsan, malaysia tel: +60-3-7955-9390, fax: +60-3-7955-9510 80 bendemeer road, unit #06-02 hyflux innovation centre singapore 339949 tel: +65-6213-0200, fax: +65-6213-0300 13f, no. 363, fu shing north road, taipei, taiwan tel: +886-2-8175-9600, fax: +886 2-8175-9670 unit 1601-1613, 16/f., tower 2, grand century place, 193 prince edward road west, mongkok, kowloon, hong kong tel: +852-2886-9318, fax: +852 2886-9022/9044 unit 204, 205, azia center, no.1233 lujiazui ring rd., pudong district, shanghai 200120, china tel: +86-21-5877-1818, fax: +86-21-6887-7858 / -7898 7th floor, quantum plaza, no.27 zhichunlu haidian district, beijing 100083, p.r.china tel: +86-10-8235-1155, fax: +86-10-8235-7679 arcadiastrasse 10, 40472 d tel: +49-211-65030, fax: +49-211-6503-1327 sseldorf, germany dukes meadow, millboard road, bourne end, buckinghamshire, sl8 5fh, u.k tel: +44-1628-651-700, fax: +44-1628-651-804 1101 nicholson road, newmarket, ontario l3y 9c3, canada tel: +1-905-898-5441, fax: +1-905-898-3220 2880 scott boulevard santa clara, ca 95050-2554, u.s.a. tel: +1-408-588-6000, fax: +1-408-588-6130 refer to "http://www.renesas.com/" for the latest and detailed information. renesas electronics canada limited renesas electronics europe limited renesas electronics america inc. renesas electronics (china) co., ltd. renesas electronics (shanghai) co., ltd. renesas electronics europe gmbh renesas electronics taiwan co., ltd. renesas electronics singapore pte. ltd. renesas electronics hong kong limited renesas electronics korea co., ltd. renesas electronics malaysia sdn.bhd. sales offices ? 2013 renesas electronics corporation. all rights reserved. colophon 2.2 meas urement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic electron ics products or technology described in this document, you should comply with the applicable export control laws and


▲Up To Search▲   

 
Price & Availability of SH7268

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X